From e26a4f9b578fc19b4ae839c4e5eb59ef5b434ddc Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Thu, 14 Nov 2024 11:08:52 -0300 Subject: [PATCH] [FIX] l10n_br_cte: add compute_sudo --- l10n_br_cte/models/document.py | 35 +++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/l10n_br_cte/models/document.py b/l10n_br_cte/models/document.py index 506415934fdf..cefc29cc2e0b 100644 --- a/l10n_br_cte/models/document.py +++ b/l10n_br_cte/models/document.py @@ -236,14 +236,23 @@ def _inverse_cte40_Id(self): .get_param("l10n_br_cte.version.name", default="Odoo Brasil OCA v14"), ) - cte40_cMunEnv = fields.Char(compute="_compute_cte40_data", store=True) + cte40_cMunEnv = fields.Char( + compute="_compute_cte40_data", + store=True, + compute_sudo=True, + ) - # cte40_xMunEnv = fields.Char(compute="_compute_cte40_data", store=True) cte40_xMunEnv = fields.Char( compute="_compute_cte40_data", + store=True, + compute_sudo=True, ) - cte40_UFEnv = fields.Char(compute="_compute_cte40_data", store=True) + cte40_UFEnv = fields.Char( + compute="_compute_cte40_data", + store=True, + compute_sudo=True, + ) cte40_indIEToma = fields.Selection( selection=[ @@ -254,17 +263,29 @@ def _inverse_cte40_Id(self): default="1", ) - cte40_cMunIni = fields.Char(compute="_compute_cte40_data") + cte40_cMunIni = fields.Char( + compute="_compute_cte40_data", + compute_sudo=True, + ) - cte40_xMunIni = fields.Char(compute="_compute_cte40_data") + cte40_xMunIni = fields.Char( + compute="_compute_cte40_data", + compute_sudo=True, + ) cte40_UFIni = fields.Char() # cte40_UFIni = fields.Char(compute="_compute_cte40_data") # cte40_UFIni = fields.Char(related="partner_sendering_id.state_id.code") - cte40_cMunFim = fields.Char(compute="_compute_cte40_data") + cte40_cMunFim = fields.Char( + compute="_compute_cte40_data", + compute_sudo=True, + ) - cte40_xMunFim = fields.Char(compute="_compute_cte40_data") + cte40_xMunFim = fields.Char( + compute="_compute_cte40_data", + compute_sudo=True, + ) cte40_UFFim = fields.Char() # cte40_UFFim = fields.Char(compute="_compute_cte40_data")