Maintainers
This module is maintained by the OCA.
- + + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
diff --git a/account_invoice_inter_company/tests/test_inter_company_invoice.py b/account_invoice_inter_company/tests/test_inter_company_invoice.py index 41cc70605e5..49e5101c123 100644 --- a/account_invoice_inter_company/tests/test_inter_company_invoice.py +++ b/account_invoice_inter_company/tests/test_inter_company_invoice.py @@ -30,6 +30,7 @@ def setUpClass(cls): "country_id": cls.env.ref("base.fr").id, "parent_id": cls.env.ref("base.main_company").id, "invoice_auto_validation": True, + "intercompany_invoicing": True, } ) cls.chart.try_loading(cls.company_a) @@ -41,6 +42,7 @@ def setUpClass(cls): "country_id": cls.env.ref("base.fr").id, "parent_id": cls.env.ref("base.main_company").id, "invoice_auto_validation": True, + "intercompany_invoicing": True, } ) cls.chart.try_loading(cls.company_b) @@ -627,3 +629,16 @@ def test_confirm_invoice_and_full_refund(self): [("auto_invoice_id", "=", refund_company_a.id)] ) self.assertEqual(len(refund), 1) + + def test_confirm_invoice_intercompany_disabled(self): + # ensure the catalog is shared + self.env.ref("product.product_comp_rule").write({"active": False}) + # Disable the configuration in company A + self.company_a.intercompany_invoicing = False + # Confirm the invoice of company A + self.invoice_company_a.with_user(self.user_company_a.id).action_post() + # Check that no destination invoice has been created in company B + invoices = self.account_move_obj.with_user(self.user_company_b.id).search( + [("auto_invoice_id", "=", self.invoice_company_a.id)] + ) + self.assertFalse(invoices) diff --git a/account_invoice_inter_company/views/res_config_settings_view.xml b/account_invoice_inter_company/views/res_config_settings_view.xml index bcfbae3e3ae..94ddeb3cf21 100644 --- a/account_invoice_inter_company/views/res_config_settings_view.xml +++ b/account_invoice_inter_company/views/res_config_settings_view.xml @@ -33,7 +33,18 @@