diff --git a/addons/l10n_ch/migrations/13.0.10.0/noupdate_changes.xml b/addons/l10n_ch/migrations/13.0.10.0/noupdate_changes.xml deleted file mode 100644 index 8f5ee930052c..000000000000 --- a/addons/l10n_ch/migrations/13.0.10.0/noupdate_changes.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - Plan comptable 2015 (Suisse) - - - diff --git a/addons/l10n_ch/migrations/13.0.11.0/noupdate_changes.xml b/addons/l10n_ch/migrations/13.0.11.0/noupdate_changes.xml index d02760aa67f1..30ef448020f4 100644 --- a/addons/l10n_ch/migrations/13.0.11.0/noupdate_changes.xml +++ b/addons/l10n_ch/migrations/13.0.11.0/noupdate_changes.xml @@ -5,6 +5,6 @@ - 1 + diff --git a/addons/l10n_ch/migrations/13.0.10.0/openupgrade_analysis.txt b/addons/l10n_ch/migrations/13.0.11.0/openupgrade_analysis_work.txt similarity index 90% rename from addons/l10n_ch/migrations/13.0.10.0/openupgrade_analysis.txt rename to addons/l10n_ch/migrations/13.0.11.0/openupgrade_analysis_work.txt index 7aec03d6efad..31245fefdb38 100644 --- a/addons/l10n_ch/migrations/13.0.10.0/openupgrade_analysis.txt +++ b/addons/l10n_ch/migrations/13.0.11.0/openupgrade_analysis_work.txt @@ -1,14 +1,20 @@ ---Models in module 'l10n_ch'--- ---Fields in module 'l10n_ch'--- l10n_ch / account.invoice / l10n_ch_isr_number (char) : DEL -l10n_ch / account.invoice / l10n_ch_isr_sent (boolean) : DEL -l10n_ch / account.journal / invoice_reference_model (False): NEW selection_keys: ['ch', 'euro', 'odoo'], mode: modify l10n_ch / account.move / l10n_ch_isr_number (char) : NEW isfunction: function, stored +l10n_ch / account.invoice / l10n_ch_isr_sent (boolean) : DEL l10n_ch / account.move / l10n_ch_isr_sent (boolean) : NEW hasdefault +# DONE: post-migration: moved fields from invoice to move + +l10n_ch / account.journal / invoice_reference_model (False): NEW selection_keys: ['ch', 'euro', 'odoo'], mode: modify +# NOTHING TO DO: new feature + l10n_ch / res.bank / l10n_ch_postal_chf (char) : DEL l10n_ch / res.bank / l10n_ch_postal_eur (char) : DEL l10n_ch / res.partner.bank / l10n_ch_isr_subscription_chf (char): NEW l10n_ch / res.partner.bank / l10n_ch_isr_subscription_eur (char): NEW +# DONE: post-migration: moved fields from bank to partner bank + ---XML records in module 'l10n_ch'--- DEL account.account.tag: l10n_ch.vat_tag_200 DEL account.account.tag: l10n_ch.vat_tag_220 @@ -34,6 +40,13 @@ DEL account.account.tag: l10n_ch.vat_tag_415 DEL account.account.tag: l10n_ch.vat_tag_420 DEL account.account.tag: l10n_ch.vat_tag_dedouanement NEW account.account.template: l10n_ch.ch_coa_1101 +# NOTHING TO DO + +account.chart.template: l10n_ch.l10nch_chart_template (noupdate switched) +# DONE: pre-migration: switched noupdate + +NEW account.fiscal.position.template: l10n_ch.fiscal_position_template_1 (noupdate) +NEW account.tax.group: l10n_ch.tax_group_tva_100 NEW account.tax.report.line: l10n_ch.account_tax_report_line_calc_impot NEW account.tax.report.line: l10n_ch.account_tax_report_line_calc_impot_base NEW account.tax.report.line: l10n_ch.account_tax_report_line_calc_impot_chiffre @@ -70,11 +83,11 @@ NEW account.tax.report.line: l10n_ch.account_tax_report_line_chtax_900 NEW account.tax.report.line: l10n_ch.account_tax_report_line_chtax_910 NEW account.tax.report.line: l10n_ch.account_tax_report_line_chtax_autres_mouv NEW account.tax.report.line: l10n_ch.account_tax_report_line_chtax_solde +NEW account.tax.template: l10n_ch.vat_100_import_invest NEW account.tax.template: l10n_ch.vat_other_movements_900 NEW account.tax.template: l10n_ch.vat_other_movements_910 -NEW ir.actions.act_window: account.action_move_out_invoice_type -DEL ir.actions.act_window: account.action_invoice_tree1 NEW ir.ui.view: l10n_ch.isr_partner_bank_tree NEW ir.ui.view: l10n_ch.isr_partner_property_bank_tree NEW ir.ui.view: l10n_ch.setup_bank_account_wizard_inherit DEL ir.ui.view: l10n_ch.isr_res_bank_form +# NOTHING TO DO diff --git a/addons/l10n_ch/migrations/13.0.11.0/post-migration.py b/addons/l10n_ch/migrations/13.0.11.0/post-migration.py new file mode 100644 index 000000000000..bf26f4bb7031 --- /dev/null +++ b/addons/l10n_ch/migrations/13.0.11.0/post-migration.py @@ -0,0 +1,33 @@ +# Copyright 2021 ForgeFlow +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +def move_from_invoices_to_moves(env): + openupgrade.logged_query( + env.cr, """ + UPDATE account_move am + SET l10n_ch_isr_number = ai.l10n_ch_isr_number, + l10n_ch_isr_sent = ai.l10n_ch_isr_sent + FROM account_invoice ai + WHERE am.old_invoice_id = ai.id""", + ) + + +def move_from_bank_to_partner_bank(env): + openupgrade.logged_query( + env.cr, """ + UPDATE res_partner_bank rpb + SET l10n_ch_isr_subscription_chf = rb.l10n_ch_postal_chf, + l10n_ch_isr_subscription_eur = rb.l10n_ch_postal_eur + FROM res_bank rb + WHERE rpb.bank_id = rb.id""", + ) + + +@openupgrade.migrate() +def migrate(env, version): + move_from_invoices_to_moves(env) + move_from_bank_to_partner_bank(env) + openupgrade.load_data( + env.cr, "l10n_ch", "migrations/13.0.11.0/noupdate_changes.xml") diff --git a/addons/l10n_ch/migrations/13.0.11.0/pre-migration.py b/addons/l10n_ch/migrations/13.0.11.0/pre-migration.py new file mode 100644 index 000000000000..b8f2225cfc38 --- /dev/null +++ b/addons/l10n_ch/migrations/13.0.11.0/pre-migration.py @@ -0,0 +1,10 @@ +# Copyright 2021 ForgeFlow +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.set_xml_ids_noupdate_value( + env, "l10n_ch", ["l10nch_chart_template"], False, + ) diff --git a/odoo/openupgrade/doc/source/modules120-130.rst b/odoo/openupgrade/doc/source/modules120-130.rst index 534eb2ff5456..6269cd9ced50 100644 --- a/odoo/openupgrade/doc/source/modules120-130.rst +++ b/odoo/openupgrade/doc/source/modules120-130.rst @@ -257,7 +257,7 @@ missing in the new release are marked with |del|. +----------------------------------------------+-------------------------------------------------+ |l10n_ca | | +----------------------------------------------+-------------------------------------------------+ -|l10n_ch | | +|l10n_ch | Done | +----------------------------------------------+-------------------------------------------------+ |l10n_cl | | +----------------------------------------------+-------------------------------------------------+