From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- .../migrations/0.0.0/pre-migrate-qr-template.py | 20 ++++++++++++++++++++ .../9.0.9.0/pre-set_tags_and_taxes_updatable.py | 9 +++++++++ 2 files changed, 29 insertions(+) create mode 100644 addons/l10n_ch/migrations/0.0.0/pre-migrate-qr-template.py create mode 100644 addons/l10n_ch/migrations/9.0.9.0/pre-set_tags_and_taxes_updatable.py (limited to 'addons/l10n_ch/migrations') diff --git a/addons/l10n_ch/migrations/0.0.0/pre-migrate-qr-template.py b/addons/l10n_ch/migrations/0.0.0/pre-migrate-qr-template.py new file mode 100644 index 00000000..070450f8 --- /dev/null +++ b/addons/l10n_ch/migrations/0.0.0/pre-migrate-qr-template.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + + +def migrate(cr, version): + """ From 12.0, to saas-13.3, l10n_ch_swissqr_template + used to inherit from another template. This isn't the case + anymore since https://github.com/odoo/odoo/commit/719f087b1b5be5f1f276a0f87670830d073f6ef4 + (made in 12.0, and forward-ported). The module will not be updatable if we + don't manually clean inherit_id. + """ + cr.execute(""" + update ir_ui_view v + set inherit_id = NULL, mode='primary' + from ir_model_data mdata + where + v.id = mdata.res_id + and mdata.model= 'ir.ui.view' + and mdata.name = 'l10n_ch_swissqr_template' + and mdata.module='l10n_ch'; + """) \ No newline at end of file diff --git a/addons/l10n_ch/migrations/9.0.9.0/pre-set_tags_and_taxes_updatable.py b/addons/l10n_ch/migrations/9.0.9.0/pre-set_tags_and_taxes_updatable.py new file mode 100644 index 00000000..8f7c27ef --- /dev/null +++ b/addons/l10n_ch/migrations/9.0.9.0/pre-set_tags_and_taxes_updatable.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- + +import odoo + +def migrate(cr, version): + registry = odoo.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') + -- cgit v1.2.3