Skip to content
Snippets Groups Projects
Commit bc3857b0 authored by Julien Van Roy's avatar Julien Van Roy
Browse files

[FIX] l10n_mx: set the 16% taxes as the default


Set the default sale and purchase taxes for the mexican CoA.

Before introducing the IEPS taxes in commit
734e18eb, the default taxes were the 16%
IVA taxes (when loading the CoA, the default is simply the first
possible match with the lowest sequence). As the IEPS taxes now have the
lowest sequence, they are incorrectly selected as the defaults. This
commit fixes this.

task-3507155

closes odoo/odoo#135858

X-original-commit: 5d98384e
Signed-off-by: default avatarLaurent Smet (las) <las@odoo.com>
Signed-off-by: default avatarJulien Van Roy (juvr) <juvr@odoo.com>
parent 447c7eb2
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,15 @@ from odoo import models, api, _
class AccountChartTemplate(models.Model):
_inherit = "account.chart.template"
def _load(self, sale_tax_rate, purchase_tax_rate, company):
res = super()._load(sale_tax_rate, purchase_tax_rate, company)
if company.chart_template_id == self.env.ref('l10n_mx.mx_coa'):
company.write({
'account_sale_tax_id': self.env.ref(f'l10n_mx.{company.id}_tax12'),
'account_purchase_tax_id': self.env.ref(f'l10n_mx.{company.id}_tax14'),
})
return res
@api.model
def generate_journals(self, acc_template_ref, company, journals_dict=None):
"""Set the tax_cash_basis_journal_id on the company"""
......
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