summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Suniaga [Vauxoo] <josemiguel@vauxoo.com>2017-09-14 17:15:55 +0000
committerqdp-odoo <qdp@odoo.com>2017-09-15 10:39:32 +0200
commit27edcaafd6c3f9aebbdcacd4ad76dbb71eb27448 (patch)
treeaf589fda9d01888bc021c83a56f1dc44e881db03
parent77566f5067ee56bab1ad7e697b7abe1b7745dcc4 (diff)
[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.
-rw-r--r--addons/l10n_mx/models/chart_template.py1
1 files changed, 1 insertions, 0 deletions
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})