Skip to content
Snippets Groups Projects
Commit 27edcaaf authored by Jose Suniaga [Vauxoo]'s avatar Jose Suniaga [Vauxoo] Committed by qdp-odoo
Browse files

[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.
parent 77566f50
No related branches found
No related tags found
No related merge requests found
......@@ -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})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment