| 1 |
|
| 2 |
|
| 3 |
from . import models |
| 4 |
from . import wizard |
| 5 |
|
| 6 |
|
| 7 |
def _l10n_es_edi_verifactu_post_init_hook(env): |
| 8 |
for company in env['res.company'].search([('chart_template', 'like', r'es\_%'), ('parent_id', '=', False)]): |
| 9 |
Template = env['account.chart.template'].with_company(company) |
| 10 |
if company.chart_template.startswith("es_canary"): |
| 11 |
tax_data = Template._get_es_verifactu_account_tax_es_canary_common() |
| 12 |
else: |
| 13 |
tax_data = Template._get_es_verifactu_account_tax_es_common_mainland() |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
tax_data = { |
| 18 |
xmlid: value |
| 19 |
for xmlid, value in tax_data.items() |
| 20 |
if Template.ref(xmlid, raise_if_not_found=False) |
| 21 |
} |
| 22 |
Template._load_data({ |
| 23 |
'account.tax': tax_data, |
| 24 |
}) |