mirror of
https://github.com/bringout/oca-ocb-l10n_europe.git
synced 2026-04-27 05:02:02 +02:00
19.0 vanilla
This commit is contained in:
parent
ff721d030e
commit
7721452493
1826 changed files with 124775 additions and 274114 deletions
|
|
@ -1,13 +1,12 @@
|
|||
# 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, {})
|
||||
# We had corrupted data, handle the correction so the tax update can proceed.
|
||||
# See https://github.com/odoo/odoo/commit/7b07df873535446f97abc1de9176b9332de5cb07
|
||||
for company in env.companies:
|
||||
for company in env['res.company'].search([('chart_template', '=', 'ch')], order="parent_path"):
|
||||
# We had corrupted data, handle the correction so the tax update can proceed.
|
||||
# See https://github.com/odoo/odoo/commit/7b07df873535446f97abc1de9176b9332de5cb07
|
||||
taxes_to_check = (f'{company.id}_vat_purchase_81_reverse', f'{company.id}_vat_77_purchase_reverse')
|
||||
tax_ids = env['ir.model.data'].search([
|
||||
('name', 'in', taxes_to_check),
|
||||
|
|
@ -19,5 +18,4 @@ def migrate(cr, version):
|
|||
# set the child to it's parent's value
|
||||
child.type_tax_use = tax.type_tax_use
|
||||
|
||||
# Update taxes
|
||||
update_taxes_from_templates(cr, 'l10n_ch.l10nch_chart_template')
|
||||
env['account.chart.template'].try_loading('ch', company, force_create=False)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
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", "=", "ch")], order="parent_path"):
|
||||
env["account.chart.template"].try_loading("ch", company)
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
import odoo
|
||||
from odoo.modules.registry import Registry
|
||||
|
||||
def migrate(cr, version):
|
||||
registry = odoo.registry(cr.dbname)
|
||||
registry = Registry(cr.dbname)
|
||||
from odoo.addons.account.models.chart_template import migrate_set_tags_and_taxes_updatable
|
||||
migrate_set_tags_and_taxes_updatable(cr, registry, 'l10n_ch')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue