From bb8e54e2cfa4b25c6aa5391d85a604f01c00a920 Mon Sep 17 00:00:00 2001 From: Giovanni Date: Tue, 24 May 2022 15:07:46 +0200 Subject: [PATCH] * l10n_it_fatturapa_in_rc, fix set rc flag --- l10n_it_fatturapa_in_rc/models/account_invoice.py | 8 ++++---- l10n_it_fatturapa_in_rc/readme/CONTRIBUTORS.rst | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/l10n_it_fatturapa_in_rc/models/account_invoice.py b/l10n_it_fatturapa_in_rc/models/account_invoice.py index 59fd055771a1..d24d570919e0 100644 --- a/l10n_it_fatturapa_in_rc/models/account_invoice.py +++ b/l10n_it_fatturapa_in_rc/models/account_invoice.py @@ -1,17 +1,17 @@ -from odoo import _, models +from odoo import _, api, models from odoo.tools import float_compare class InvoiceLine(models.Model): _inherit = "account.move.line" - def _set_rc_flag(self, invoice): - self.ensure_one() + @api.depends("move_id", "move_id.fiscal_position_id", "tax_ids") + def _compute_rc_flag(self): if "fatturapa.attachment.in" in self.env.context.get("active_model", []): # this means we are importing an e-invoice, # so RC flag is already set, where needed return - return super(InvoiceLine, self)._set_rc_flag(invoice) + super()._compute_rc_flag() class Invoice(models.Model): diff --git a/l10n_it_fatturapa_in_rc/readme/CONTRIBUTORS.rst b/l10n_it_fatturapa_in_rc/readme/CONTRIBUTORS.rst index ea72e0dcd84b..9e1c095f22b4 100644 --- a/l10n_it_fatturapa_in_rc/readme/CONTRIBUTORS.rst +++ b/l10n_it_fatturapa_in_rc/readme/CONTRIBUTORS.rst @@ -1,3 +1,7 @@ * Sergio Corato * Lorenzo Battistini * Marco Colombo + +* `Ooops `_: + + * Giovanni Serra