From 0eefd4e5f29ece0f5a76be8ad2fb11df7e9763b9 Mon Sep 17 00:00:00 2001 From: Marco Colombo Date: Fri, 16 Jul 2021 10:40:24 +0200 Subject: [PATCH] [14.0][FIX] l10n_it_fatturapa_in: Fixed singleton error on field computation Fixes: https://github.com/OCA/l10n-italy/issues/2349 --- l10n_it_fatturapa_in/models/account.py | 1 - l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/l10n_it_fatturapa_in/models/account.py b/l10n_it_fatturapa_in/models/account.py index df3ffdc027d2..7224cdfc4c6f 100644 --- a/l10n_it_fatturapa_in/models/account.py +++ b/l10n_it_fatturapa_in/models/account.py @@ -174,7 +174,6 @@ def e_inv_dati_ritenuta(self): "invoice_date", ) def _compute_e_invoice_validation_error(self): - self.ensure_one() self.e_invoice_validation_error = False self.e_invoice_validation_message = False diff --git a/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py b/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py index 3550b66e5665..99e290c658a3 100644 --- a/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py +++ b/l10n_it_fatturapa_in/tests/test_import_fatturapa_xml.py @@ -935,6 +935,12 @@ def test_xml_import_summary_tax_rate(self): self.assertEqual(invoice.invoice_line_ids[1].price_unit, 3.52) self.assertEqual(invoice.invoice_line_ids[1].quantity, 1.0) + def test_e_invoice_field_compute(self): + """Check successful creation of multiple invoices. + See https://github.com/OCA/l10n-italy/issues/2349""" + invoices = self.invoice_model.create([{}, {}]) + self.assertEqual(invoices.mapped("e_invoice_validation_error"), [False, False]) + class TestFatturaPAEnasarco(FatturapaCommon): def setUp(self):