19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:28 +01:00
parent ff721d030e
commit 7721452493
1826 changed files with 124775 additions and 274114 deletions

View file

@ -1,7 +0,0 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.account.models.chart_template import update_taxes_from_templates
def migrate(cr, version):
update_taxes_from_templates(cr, 'l10n_es.account_chart_template_common')

View file

@ -1,11 +1,10 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, SUPERUSER_ID
from odoo.addons.account.models.chart_template import update_taxes_from_templates
def migrate(cr, version):
env = api.Environment(cr, SUPERUSER_ID, {})
for company in env.companies:
for company in env['res.company'].search([('chart_template', 'like', 'es_%')], order="parent_path"):
taxes_to_disable = (
f'{company.id}_account_tax_template_p_iva5_ic_bc',
f'{company.id}_account_tax_template_p_iva5_ic_sc',
@ -24,5 +23,4 @@ def migrate(cr, version):
('model', '=', 'account.tax'),
]).mapped('res_id')
env['account.tax'].browse(tax_ids).active = False
update_taxes_from_templates(cr, 'l10n_es.account_chart_template_common')
env['account.chart.template'].try_loading(company.chart_template, company, force_create=False)

View file

@ -0,0 +1,7 @@
from odoo import api, SUPERUSER_ID
def migrate(cr, version):
env = api.Environment(cr, SUPERUSER_ID, {})
for company in env['res.company'].search([('chart_template', 'like', r'es\_%')], order="parent_path"):
env['account.chart.template'].try_loading(company.chart_template, company, force_create=False)