From 44a073fd5b86ef2b0f605ea133627bf5cded84fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Mon, 3 Jul 2023 23:12:05 -0300 Subject: [PATCH] [REF] read A1 through sudo() --- l10n_br_nfe/models/document.py | 6 +++--- l10n_br_nfe/models/invalidate_number.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/l10n_br_nfe/models/document.py b/l10n_br_nfe/models/document.py index 1d126d69add8..5c0e6e81a5a8 100644 --- a/l10n_br_nfe/models/document.py +++ b/l10n_br_nfe/models/document.py @@ -727,12 +727,12 @@ def _serialize(self, edocs): return edocs def _processador(self): - if not self.company_id.certificate_nfe_id: + if not self.company_id.sudo().certificate_nfe_id: raise UserError(_("Certificado não encontrado")) certificado = cert.Certificado( - arquivo=self.company_id.certificate_nfe_id.file, - senha=self.company_id.certificate_nfe_id.password, + arquivo=self.company_id.sudo().certificate_nfe_id.file, + senha=self.company_id.sudo().certificate_nfe_id.password, ) session = Session() session.verify = False diff --git a/l10n_br_nfe/models/invalidate_number.py b/l10n_br_nfe/models/invalidate_number.py index 02114de5fbf8..0ac047dffad4 100644 --- a/l10n_br_nfe/models/invalidate_number.py +++ b/l10n_br_nfe/models/invalidate_number.py @@ -26,12 +26,12 @@ class InvalidateNumber(models.Model): _inherit = "l10n_br_fiscal.invalidate.number" def _processador(self): - if not self.company_id.certificate_nfe_id: + if not self.company_id.sudo().certificate_nfe_id: raise UserError(_("Certificado não encontrado")) certificado = cert.Certificado( - arquivo=self.company_id.certificate_nfe_id.file, - senha=self.company_id.certificate_nfe_id.password, + arquivo=self.company_id.sudo().certificate_nfe_id.file, + senha=self.company_id.sudo().certificate_nfe_id.password, ) session = Session() session.verify = False