diff --git a/l10n_it_account_stamp/migrations/17.5.0.0.1/noupdate_changes.xml b/l10n_it_account_stamp/migrations/17.5.0.0.1/noupdate_changes.xml new file mode 100644 index 00000000000..0f5b65579c2 --- /dev/null +++ b/l10n_it_account_stamp/migrations/17.5.0.0.1/noupdate_changes.xml @@ -0,0 +1,14 @@ + + + + Stamp duty 2 euro + + + + + + + diff --git a/l10n_it_account_stamp/migrations/17.5.0.0.1/post-migration.py b/l10n_it_account_stamp/migrations/17.5.0.0.1/post-migration.py new file mode 100644 index 00000000000..993f1520254 --- /dev/null +++ b/l10n_it_account_stamp/migrations/17.5.0.0.1/post-migration.py @@ -0,0 +1,10 @@ +# Copyright 2024 Sergio Zanchetta +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + openupgrade.load_data(env.cr, "l10n_it_account_stamp", "17.5.0.0.1/noupdate_changes.xml") + openupgrade.delete_record_translations(env.cr, "l10n_it_account_stamp", ["l10n_it_account_stamp_2_euro"]) diff --git a/l10n_it_account_stamp/migrations/17.5.0.0.1/pre-migrate.py b/l10n_it_account_stamp/migrations/17.5.0.0.1/pre-migrate.py new file mode 100644 index 00000000000..e437a3969ed --- /dev/null +++ b/l10n_it_account_stamp/migrations/17.5.0.0.1/pre-migrate.py @@ -0,0 +1,58 @@ +# Copyright 2024 Sergio Zanchetta +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from openupgradelib import openupgrade + + +def _rename_fields(env): + openupgrade.rename_fields( + env, + [ + ( + "account.move", + "account_move", + "l10n_it_account_stamp_is_tax_stamp_applied", + "l10n_it_account_stamp_is_stamp_duty_applied", + ), + ( + "account.move", + "account_move", + "l10n_it_account_stamp_is_tax_stamp_present", + "l10n_it_account_stamp_is_stamp_duty_present", + ), + ( + "account.move", + "account_move", + "l10n_it_account_stamp_auto_compute_tax_stamp", + "l10n_it_account_stamp_auto_compute_stamp_duty", + ), + ( + "account.move", + "account_move", + "l10n_it_account_stamp_manually_apply_tax_stamp", + "l10n_it_account_stamp_manually_apply_stamp_duty", + ), + ( + "res.company", + "res_company", + "l10n_it_account_stamp_tax_stamp_product_id", + "l10n_it_account_stamp_stamp_duty_product_id", + ), + ( + "res.config.settings", + "res_config_settings", + "l10n_it_account_stamp_tax_stamp_product_id", + "l10n_it_account_stamp_stamp_duty_product_id", + ), + ( + "product.template", + "product_template", + "l10n_it_account_stamp_tax_stamp_apply_tax_ids", + "l10n_it_account_stamp_stamp_duty_apply_tax_ids", + ), + ], + ) + +@openupgrade.migrate() +def migrate(env, version): + _rename_fields(env)