Files
odoo_source/addons/l10n_it_edi/__init__.py
T
MerlinGuillaume 0d4f6799f8 [FIX] l10n_it_edi: create 0% EU tax with correct exoneration values
The italian company of the demo data and new companies with the italian
fiscal localization have the tax "0% EU" with incorrect configuration

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 (same for
   the demo data italian company)

Solution:
Update the tax "0% EU" with the correct configuration in the
`post_init_hook` and in `_post_load_data`

opw-3414593

closes odoo/odoo#132754

X-original-commit: 5cb17244ca8b457e3964c7c6a115d132d0b6ab56
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-08-24 18:37:43 +02:00

22 lines
659 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
from . import tools
from . import wizard
def _l10n_it_edi_update_export_tax(env):
for company in env['res.company'].search([('chart_template', '=', 'it')]):
tax = env.ref(f'account.{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',
})
def _l10n_it_edi_post_init(env):
_l10n_it_edi_update_export_tax(env)