| 1 |
# -*- coding: utf-8 -*- |
| 2 |
from . import models, wizard |
| 3 |
|
| 4 |
|
| 5 |
def _l10n_sa_edi_post_init(env): |
| 6 |
for company in env['res.company'].search([('chart_template', '=', 'sa'), ('parent_id', '=', False)]): |
| 7 |
Template = env['account.chart.template'].with_company(company) |
| 8 |
tax_data = Template._get_sa_edi_account_tax() |
| 9 |
|
| 10 |
tax_data = { |
| 11 |
xmlid: values |
| 12 |
for xmlid, values in tax_data.items() |
| 13 |
if Template.ref(xmlid, raise_if_not_found=False) |
| 14 |
} |
| 15 |
# Update existing taxes only |
| 16 |
if tax_data: |
| 17 |
Template._load_data({ |
| 18 |
'account.tax': tax_data, |
| 19 |
}) |