diff --git a/delivery_auto_refresh/tests/test_delivery_auto_refresh.py b/delivery_auto_refresh/tests/test_delivery_auto_refresh.py index 81d0cecbd9..c72a7e209c 100644 --- a/delivery_auto_refresh/tests/test_delivery_auto_refresh.py +++ b/delivery_auto_refresh/tests/test_delivery_auto_refresh.py @@ -17,6 +17,15 @@ class TestDeliveryAutoRefresh(common.TransactionCase): def setUpClass(cls): super().setUpClass() cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + if not cls.env.company.chart_template_id: + # Load a CoA if there's none in current company + coa = cls.env.ref("l10n_generic_coa.configurable_chart_template", False) + if not coa: + # Load the first available CoA + coa = cls.env["account.chart.template"].search( + [("visible", "=", True)], limit=1 + ) + coa.try_loading(company=cls.env.company, install_demo=False) cls.env.user.write( { "groups_id": [