diff --git a/addons/l10n_sa_edi/models/account_move.py b/addons/l10n_sa_edi/models/account_move.py index aba3bbdeb3c..04a202bd2c2 100644 --- a/addons/l10n_sa_edi/models/account_move.py +++ b/addons/l10n_sa_edi/models/account_move.py @@ -47,7 +47,7 @@ class AccountMove(models.Model): qr_code_str = move._l10n_sa_get_qr_code(move.journal_id, xml_content, b64decode(x509_cert), move.l10n_sa_invoice_signature, True) qr_code_str = b64encode(qr_code_str).decode() - elif zatca_document.state == 'sent' and zatca_document.attachment_id.datas: + elif zatca_document.state == 'sent' and zatca_document.sudo().attachment_id.datas: document_xml = zatca_document.attachment_id.with_context(bin_size=False).datas.decode() root = etree.fromstring(b64decode(document_xml)) qr_node = root.xpath('//*[local-name()="ID"][text()="QR"]/following-sibling::*/*')[0]