Skip to content

Commit

Permalink
[FIX] l10n_br_cte: add compute_sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelsavegnago committed Nov 14, 2024
1 parent 9325e19 commit e26a4f9
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions l10n_br_cte/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand All @@ -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")
Expand Down

0 comments on commit e26a4f9

Please sign in to comment.