From 9c5a98ffbe72531098b7c10c676b2c616284fd9b Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Mon, 1 Apr 2019 17:50:07 +0200 Subject: [PATCH] [FIX] account_banking_sepa_credit_transfer: Pass tests when any l10n_* is installed Default values for sale_tax_id and purchase_tax_id are from other char template in these cases, and as generic CoA is not marked as full tax chart, these values are tried to be used, getting an error. We assure through this method to not have it. --- .../tests/test_sct.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/account_banking_sepa_credit_transfer/tests/test_sct.py b/account_banking_sepa_credit_transfer/tests/test_sct.py index 37fb039d8..cb9e76b32 100644 --- a/account_banking_sepa_credit_transfer/tests/test_sct.py +++ b/account_banking_sepa_credit_transfer/tests/test_sct.py @@ -38,9 +38,22 @@ class TestSCT(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() + # Install template chart through this method for avoiding problem + # when setting sales and purchase default taxes (bad code in Odoo) + 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': chart.code_digits, + 'transfer_account_id': chart.transfer_account_id.id, + 'currency_id': chart.currency_id.id, + 'bank_account_code_prefix': chart.bank_account_code_prefix, + 'cash_account_code_prefix': chart.cash_account_code_prefix, + 'sale_tax_id': False, + 'purchase_tax_id': False, + }) + wizard.onchange_chart_template_id() + wizard.execute() self.account_expense = self.account_model.search([ ('user_type_id', '=', self.env.ref('account.data_account_type_expenses').id),