Skip to content

Commit 67497bf

Browse files
committed
Merge PR #3771 into 16.0
Signed-off-by antoniospneto
2 parents 3d7b2a2 + df686ca commit 67497bf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

l10n_br_nfe/models/document.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,13 @@ def _check_document_date_key(self):
853853
key_date_str = rec.document_key[2:6]
854854
key_date = datetime.strptime(key_date_str, "%y%m")
855855

856-
document_date = fields.Datetime.from_string(rec.document_date)
856+
# 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+
857863
if rec.state_edoc in ["a_enviar", "autorizada"] and (
858864
key_date.year != document_date.year
859865
or key_date.month != document_date.month

0 commit comments

Comments
 (0)