From 2f76c7b2711ee45ddf97170b5be3e68ec0ab4f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Sat, 16 Nov 2024 15:54:08 +0000 Subject: [PATCH] [FIX] l10n_br_account: state tests when no EDI since https://github.com/OCA/l10n-brazil/pull/3012 when l10n_br_fiscal_edi is not installed, these tests were failing --- l10n_br_account/tests/test_account_move_lc.py | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/l10n_br_account/tests/test_account_move_lc.py b/l10n_br_account/tests/test_account_move_lc.py index ef008c7efb60..b193ca848531 100644 --- a/l10n_br_account/tests/test_account_move_lc.py +++ b/l10n_br_account/tests/test_account_move_lc.py @@ -1775,16 +1775,20 @@ def test_change_states(self): self.assertEqual(document_id.state, "em_digitacao") self.move_out_venda.action_post() self.assertEqual(self.move_out_venda.state, "posted") - self.assertEqual(document_id.state, "a_enviar") - self.move_out_venda.button_draft() - self.assertEqual(self.move_out_venda.state, "draft") - self.assertEqual(document_id.state, "em_digitacao") - document_id.action_document_confirm() - self.assertEqual(self.move_out_venda.state, "posted") - self.assertEqual(document_id.state, "a_enviar") - document_id.action_document_back2draft() - self.assertEqual(self.move_out_venda.state, "draft") - self.assertEqual(document_id.state, "em_digitacao") + fiscal_edi = self.env["ir.module.module"].search( + [("name", "=", "l10n_br_fiscal_edi")] + ) + if fiscal_edi and fiscal_edi.installed: + self.assertEqual(document_id.state, "a_enviar") + self.move_out_venda.button_draft() + self.assertEqual(self.move_out_venda.state, "draft") + self.assertEqual(document_id.state, "em_digitacao") + document_id.action_document_confirm() + self.assertEqual(self.move_out_venda.state, "posted") + self.assertEqual(document_id.state, "a_enviar") + document_id.action_document_back2draft() + self.assertEqual(self.move_out_venda.state, "draft") + self.assertEqual(document_id.state, "em_digitacao") def test_document_deny(self): document_id = self.move_out_venda.fiscal_document_id