We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3d7b2a2 + df686ca commit 67497bfCopy full SHA for 67497bf
l10n_br_nfe/models/document.py
@@ -853,7 +853,13 @@ def _check_document_date_key(self):
853
key_date_str = rec.document_key[2:6]
854
key_date = datetime.strptime(key_date_str, "%y%m")
855
856
- document_date = fields.Datetime.from_string(rec.document_date)
+ # Converting the document_date to the user's timezone
857
+ # This is necessary because the NFe is printed
858
+ # using the user's local timezone
859
+ document_date = fields.Datetime.context_timestamp(
860
+ rec, rec.document_date
861
+ )
862
+
863
if rec.state_edoc in ["a_enviar", "autorizada"] and (
864
key_date.year != document_date.year
865
or key_date.month != document_date.month
0 commit comments