From 162c479ce3dbfdf04a05957e75a7e47d6376794e Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Thu, 23 Nov 2023 17:02:01 +0100 Subject: [PATCH] [FIX] l10n_sa_edi: B2C QRCode IssueTime Warning Have an Invoice partner with type Individual Create an invoice with said customer confirm. ZATCA invoice has warning "invoiceTimeStamp_QRCODE_INVALID". ``` {"type":"WARNING", "code":"invoiceTimeStamp_QRCODE_INVALID", "category":"QRCODE_VALIDATION", "message":"Time on QR Code does not match with Invoice Issue Time (KSA-25). If ZATCA's SDK was used to generate QR Code, kindly use the latest version of SDK", "status":"WARNING"} ``` This occurs because when the Invoice partner is an Individual the validation requires an additional QR code enclosing invoice information that needs to match the xml content. In this case the IssueTime of the invoice was not matching because the QR is manually formatted with a wrong 'Z' at the end, while its timezone is, correctly, Asia/Riyadh opw-3586326 closes odoo/odoo#143697 X-original-commit: da50d78ee73661cb2af599e0f4276f3d9a891e16 Signed-off-by: Josse Colpaert --- addons/l10n_sa_edi/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/l10n_sa_edi/models/account_move.py b/addons/l10n_sa_edi/models/account_move.py index b146b4cfc14..4e8a0951425 100644 --- a/addons/l10n_sa_edi/models/account_move.py +++ b/addons/l10n_sa_edi/models/account_move.py @@ -101,7 +101,7 @@ class AccountMove(models.Model): seller_name_enc = self._l10n_sa_get_qr_code_encoding(1, journal_id.company_id.display_name.encode()) seller_vat_enc = self._l10n_sa_get_qr_code_encoding(2, journal_id.company_id.vat.encode()) timestamp_enc = self._l10n_sa_get_qr_code_encoding(3, - invoice_datetime.strftime("%Y-%m-%dT%H:%M:%SZ").encode()) + invoice_datetime.strftime("%Y-%m-%dT%H:%M:%S").encode()) amount_total_enc = self._l10n_sa_get_qr_code_encoding(4, float_repr(abs(amount_total), 2).encode()) amount_tax_enc = self._l10n_sa_get_qr_code_encoding(5, float_repr(abs(amount_tax), 2).encode()) invoice_hash_enc = self._l10n_sa_get_qr_code_encoding(6, invoice_hash)