Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX l10n_it_fatturapa_in, Setting Italian timezone by default, otherw… #4563

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion l10n_it_fatturapa_in/wizard/wizard_import_fatturapa.py
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,22 @@ def _prepare_invoice_values(self, fatt, fatturapa_attachment, FatturaBody, partn
if causLst:
for rel_doc in causLst:
comment += rel_doc + "\n"
e_invoice_received_date = self._get_received_date(fatturapa_attachment)

if (
not fatturapa_attachment.env.context.get("tz")
and not fatturapa_attachment.env.user.tz
):
# Setting Italian timezone, otherwise e_invoice_received_date
# could be set the day before of the actual date.
fatturapa_attachment = fatturapa_attachment.with_context(tz="Europe/Rome")
if fatturapa_attachment.e_invoice_received_date:
e_invoice_received_date = fields.Datetime.context_timestamp(
fatturapa_attachment, fatturapa_attachment.e_invoice_received_date
).date()
else:
e_invoice_received_date = fields.Datetime.context_timestamp(
fatturapa_attachment, fatturapa_attachment.create_date
).date()
e_invoice_date = datetime.strptime(
FatturaBody.DatiGenerali.DatiGeneraliDocumento.Data, "%Y-%m-%d"
).date()
Expand Down
Loading