File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33import xlrd
44from werkzeug .urls import url_encode
55
6+ from odoo .tests import tagged
7+
68from odoo .addons .intrastat_base .tests .common import IntrastatCommon
79
810
11+ @tagged ("post_install" , "-at_install" )
912class IntrastatProductCommon (IntrastatCommon ):
1013 @classmethod
1114 def _init_products (cls ):
@@ -72,6 +75,15 @@ def _init_transaction(cls):
7275 @classmethod
7376 def setUpClass (cls ):
7477 super ().setUpClass ()
78+ if not cls .env .company .chart_template_id :
79+ # Load a CoA if there's none in current company
80+ coa = cls .env .ref ("l10n_generic_coa.configurable_chart_template" , False )
81+ if not coa :
82+ # Load the first available CoA
83+ coa = cls .env ["account.chart.template" ].search (
84+ [("visible" , "=" , True )], limit = 1
85+ )
86+ coa .try_loading (company = cls .env .company , install_demo = False )
7587 cls .region_obj = cls .env ["intrastat.region" ]
7688 cls .transaction_obj = cls .env ["intrastat.transaction" ]
7789 cls .transport_mode_obj = cls .env ["intrastat.transport_mode" ]
You can’t perform that action at this time.
0 commit comments