From c4da2917a671ca3a33b452b46e9ba0f248edf31d Mon Sep 17 00:00:00 2001 From: Marcel Savegnago Date: Fri, 15 Nov 2024 14:29:34 -0300 Subject: [PATCH] [FIX] l10n_br_nfe: methods names --- l10n_br_nfe/models/document.py | 12 ++++++------ l10n_br_nfe/tests/test_nfce.py | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/l10n_br_nfe/models/document.py b/l10n_br_nfe/models/document.py index 2b1d68316190..abdfcc7092b0 100644 --- a/l10n_br_nfe/models/document.py +++ b/l10n_br_nfe/models/document.py @@ -377,7 +377,7 @@ def _inverse_nfe40_dhSaiEnt(self): # specially when importing (ERP NFe migration vs supplier Nfe). nfe40_emit = fields.Many2one( comodel_name="res.company", - compute="_compute_emit_data", + compute="_compute_nfe_emit_data", string="Emit", ) @@ -391,7 +391,7 @@ def _inverse_nfe40_dhSaiEnt(self): # Compute Methods ########################## - def _compute_emit_data(self): + def _compute_nfe_emit_data(self): for doc in self: # TODO if out doc.nfe40_emit = doc.company_id @@ -414,7 +414,7 @@ def _set_nfe40_IEST(self): nfe40_dest = fields.Many2one( comodel_name="res.partner", - compute="_compute_dest_data", + compute="_compute_nfe_dest_data", readonly=True, string="Dest", ) @@ -430,7 +430,7 @@ def _set_nfe40_IEST(self): ########################## @api.depends("partner_id") - def _compute_dest_data(self): + def _compute_nfe_dest_data(self): for doc in self: # TODO if out if ( doc.partner_id.is_anonymous_consumer @@ -447,7 +447,7 @@ def _compute_dest_data(self): nfe40_entrega = fields.Many2one( comodel_name="res.partner", - compute="_compute_entrega_data", + compute="_compute_nfe_entrega_data", string="Entrega", ) @@ -457,7 +457,7 @@ def _compute_dest_data(self): ########################## @api.depends("partner_shipping_id") - def _compute_entrega_data(self): + def _compute_nfe_entrega_data(self): for rec in self: if ( rec.document_type == MODELO_FISCAL_NFCE diff --git a/l10n_br_nfe/tests/test_nfce.py b/l10n_br_nfe/tests/test_nfce.py index fb840ce543d3..9bc9f964f9da 100644 --- a/l10n_br_nfe/tests/test_nfce.py +++ b/l10n_br_nfe/tests/test_nfce.py @@ -228,8 +228,8 @@ def test_compute_fiscal_document_fields(self): self.document_id.partner_id.cnpj_cpf = False self.document_id.partner_shipping_id = self.document_id.partner_id - self.document_id._compute_entrega_data() + self.document_id._compute_nfe_entrega_data() self.assertFalse(self.document_id.nfe40_entrega) - self.document_id._compute_dest_data() + self.document_id._compute_nfe_dest_data() self.assertFalse(self.document_id.nfe40_dest)