From 673ce8beeb57ab8ef126d80f290f55d899b994a1 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 26 Mar 2018 14:11:38 +0200 Subject: [PATCH] [FIX] account_banking_sepa_direct_debit: Avoid problems in DBs with other localizations If you have another localization installed, this test is not going to work, as the defaults assign other taxes as defaults, and the generic CoA is marked as not complete set, so values are not set either on onchange. --- .../tests/test_sdd.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/account_banking_sepa_direct_debit/tests/test_sdd.py b/account_banking_sepa_direct_debit/tests/test_sdd.py index 882543538..fa589c994 100644 --- a/account_banking_sepa_direct_debit/tests/test_sdd.py +++ b/account_banking_sepa_direct_debit/tests/test_sdd.py @@ -37,9 +37,19 @@ class TestSDD(common.HttpCase): 'company_ids': [(6, 0, self.main_company.ids)], 'company_id': self.main_company.id, }) - self.env.ref( - 'l10n_generic_coa.configurable_chart_template' - ).try_loading_for_current_company() + chart = self.env.ref('l10n_generic_coa.configurable_chart_template') + wizard = self.env['wizard.multi.charts.accounts'].create({ + 'company_id': self.main_company.id, + 'chart_template_id': chart.id, + 'code_digits': 6, + 'currency_id': self.env.ref('base.EUR').id, + 'transfer_account_id': chart.transfer_account_id.id, + # Set these values for not letting the dangerous default ones + 'sale_tax_id': False, + 'purchase_tax_id': False, + }) + wizard.onchange_chart_template_id() + wizard.execute() self.partner_agrolait = self.env.ref('base.res_partner_2') self.partner_c2c = self.env.ref('base.res_partner_12') self.partner_agrolait.company_id = self.main_company.id