From 61fe7a782002abb5d7cd7394d83a81f6248267e9 Mon Sep 17 00:00:00 2001 From: qdp-odoo Date: Mon, 23 Apr 2018 16:47:00 +0200 Subject: [PATCH] [FIX] account: allow switching from CoA if empty moves exists This is needed in case we open the Chart of Account step from the configuration bar, as it will silently create the opening journal entry --- addons/account/models/chart_template.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index f2e5183eee0..8de2ea0f685 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -847,7 +847,7 @@ class WizardMultiChartsAccounts(models.TransientModel): @api.multi def existing_accounting(self, company_id): - model_to_check = ['account.move.line', 'account.invoice', 'account.move', 'account.payment', 'account.bank.statement'] + model_to_check = ['account.move.line', 'account.invoice', 'account.payment', 'account.bank.statement'] for model in model_to_check: if len(self.env[model].search([('company_id', '=', company_id.id)])) > 0: return True @@ -882,7 +882,7 @@ class WizardMultiChartsAccounts(models.TransientModel): accounting_props.unlink() # delete account, journal, tax, fiscal position and reconciliation model - models_to_delete = ['account.reconcile.model', 'account.fiscal.position', 'account.tax', 'account.journal'] + models_to_delete = ['account.reconcile.model', 'account.fiscal.position', 'account.tax', 'account.move', 'account.journal'] for model in models_to_delete: res = self.env[model].search([('company_id', '=', self.company_id.id)]) if len(res):