From 27edcaafd6c3f9aebbdcacd4ad76dbb71eb27448 Mon Sep 17 00:00:00 2001 From: "Jose Suniaga [Vauxoo]" Date: Thu, 14 Sep 2017 17:15:55 +0000 Subject: [PATCH] [FIX] l10n_mx: company in the journal cash basis configuration When have more than one company, for all companies, the cash basis journal set in accounting configuration will be always the related to first company. This issue cause the followiong error trying to validate an invoice for a company different to fisrt one: 'Cannot create moves for different companies.' Because exist a 'cross-configuration' in the cash basis journal. The solution to this issue is include the company in domain that does the search for cash basis journal. --- addons/l10n_mx/models/chart_template.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/l10n_mx/models/chart_template.py b/addons/l10n_mx/models/chart_template.py index 4e1397073ba..d6607a7a359 100644 --- a/addons/l10n_mx/models/chart_template.py +++ b/addons/l10n_mx/models/chart_template.py @@ -16,6 +16,7 @@ class AccountChartTemplate(models.Model): if not self == self.env.ref('l10n_mx.mx_coa'): return res journal_basis = self.env['account.journal'].search([ + ('company_id', '=', company.id), ('type', '=', 'general'), ('code', '=', 'CBMX')], limit=1) company.write({'tax_cash_basis_journal_id': journal_basis.id})