diff --git a/addons/account_edi/models/account_move.py b/addons/account_edi/models/account_move.py index 3799faa645c..181ed78e059 100644 --- a/addons/account_edi/models/account_move.py +++ b/addons/account_edi/models/account_move.py @@ -617,9 +617,9 @@ class AccountMove(models.Model): # Business operations #################################################### - def action_process_edi_web_services(self): + def action_process_edi_web_services(self, with_commit=True): docs = self.edi_document_ids.filtered(lambda d: d.state in ('to_send', 'to_cancel') and d.blocking_level != 'error') - docs._process_documents_web_services() + docs._process_documents_web_services(with_commit=with_commit) def _retry_edi_documents_error_hook(self): ''' Hook called when edi_documents are retried. For example, when it's needed to clean a field. diff --git a/addons/l10n_es_edi_sii/tests/test_edi_web_services.py b/addons/l10n_es_edi_sii/tests/test_edi_web_services.py index 03ef47c0d66..b9780c0eeb0 100644 --- a/addons/l10n_es_edi_sii/tests/test_edi_web_services.py +++ b/addons/l10n_es_edi_sii/tests/test_edi_web_services.py @@ -53,7 +53,7 @@ class TestEdiWebServices(TestEsEdiCommon): def test_edi_aeat(self): self.env.company.l10n_es_edi_tax_agency = 'aeat' - self.moves.action_process_edi_web_services() + self.moves.action_process_edi_web_services(with_commit=False) generated_files = self._process_documents_web_services(self.moves, {'es_sii'}) self.assertTrue(generated_files) self.assertRecordValues(self.out_invoice, [{'edi_state': 'sent'}]) @@ -62,7 +62,7 @@ class TestEdiWebServices(TestEsEdiCommon): def test_edi_gipuzkoa(self): self.env.company.l10n_es_edi_tax_agency = 'gipuzkoa' - self.moves.action_process_edi_web_services() + self.moves.action_process_edi_web_services(with_commit=False) generated_files = self._process_documents_web_services(self.moves, {'es_sii'}) self.assertTrue(generated_files) self.assertRecordValues(self.out_invoice, [{'edi_state': 'sent'}]) @@ -71,7 +71,7 @@ class TestEdiWebServices(TestEsEdiCommon): def test_edi_bizkaia(self): self.env.company.l10n_es_edi_tax_agency = 'bizkaia' - self.moves.action_process_edi_web_services() + self.moves.action_process_edi_web_services(with_commit=False) generated_files = self._process_documents_web_services(self.moves, {'es_sii'}) self.assertTrue(generated_files) self.assertRecordValues(self.out_invoice, [{'edi_state': 'sent'}])