Skip to content
Snippets Groups Projects
Commit f6b386c3 authored by MerlinGuillaume's avatar MerlinGuillaume
Browse files

[FIX] l10n_it_edi: create 0% EU tax with correct exoneration values


When creating a new company with the italian fiscal localization, the
tax "0% EU" is not instanciated properly

Steps to reproduce:
1. Install Accounting and module l10n_it_edi
2. Create a new company and select it
3. Go to Settings > Accounting > Fiscal Localization, set it to `Italy -
   Generic Chart of Accounts` and save
4. Go to Accounting > Configuration > Taxes and open tax "0% EU"
5. The fields for the italian exoneration are not properly set, they
   should have the same values as the same tax for company "IT Company"
   of the demo data

Solution:
When we set the company chart template, update tax "0% EU" with the
correct values

opw-3414593

closes odoo/odoo#131996

Signed-off-by: default avatarOlivier Colson (oco) <oco@odoo.com>
parent dac9bc89
No related branches found
No related tags found
No related merge requests found
......@@ -5,5 +5,6 @@ from . import res_partner
from . import res_company
from . import account_invoice
from . import account_edi_format
from . import account_chart_template
from . import ir_mail_server
from . import ddt
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
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 self == self.env.ref('l10n_it.l10n_it_chart_template_generic', raise_if_not_found=False):
tax = self.env.ref(f'l10n_it.{company.id}_00eu', raise_if_not_found=False)
if tax:
tax.write({
'l10n_it_has_exoneration': True,
'l10n_it_kind_exoneration': 'N3.2',
'l10n_it_law_reference': 'Art. 41, DL n. 331/93',
})
return res
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