-
-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] l10n_it_account_stamp: migration scripts
- Loading branch information
1 parent
2b02d23
commit 6340163
Showing
8 changed files
with
208 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
l10n_it_account_stamp/migrations/18.0.1.0.0/noupdate_changes.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version='1.0' encoding='utf-8' ?> | ||
<odoo> | ||
<record id="l10n_it_account_stamp_2_euro" model="product.product"> | ||
<field name="name">Stamp duty 2 euro</field> | ||
</record> | ||
<record id="base.main_company" model="res.company"> | ||
<field | ||
name="l10n_it_account_stamp_stamp_duty_product_id" | ||
ref="l10n_it_account_stamp.l10n_it_account_stamp_2_euro" | ||
/> | ||
</record> | ||
</odoo> |
14 changes: 14 additions & 0 deletions
14
l10n_it_account_stamp/migrations/18.0.1.0.0/post-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 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", "18.0.1.0.0/noupdate_changes.xml" | ||
) | ||
openupgrade.delete_record_translations( | ||
env.cr, "l10n_it_account_stamp", ["l10n_it_account_stamp_2_euro"] | ||
) |
59 changes: 59 additions & 0 deletions
59
l10n_it_account_stamp/migrations/18.0.1.0.0/pre-migrate.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# 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) |
59 changes: 59 additions & 0 deletions
59
l10n_it_account_stamp/migrations/18.0.1.0.0/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
** Italiano ** | ||
|
||
Sono stati aggiunti gli script di migrazione, da provare quando saranno rilasciati quelli relativi ad `account`. | ||
|
||
** English ** | ||
|
||
Migration scripts have been added, to be tested when `account` related ones will be released. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters