-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][IMP] rename fields in l10n_fr_ecotaxe module
[16.0][IMP] rename fields in l10n_fr_ecotaxe module rest of modif & imp product view
- Loading branch information
1 parent
cd691c9
commit 38f0f04
Showing
14 changed files
with
345 additions
and
122 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
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,201 @@ | ||
# Copyright 2024 Akretion France (http://www.akretion.com/) | ||
# @author Mourad EL HADJ MIMOUNE <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
if not openupgrade.column_exists( | ||
env.cr, "account_ecotaxe_classification", "categ_id" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.ecotaxe.classification", | ||
"accoun_tecotaxe_classification", | ||
"account_ecotaxe_categ_id", | ||
"categ_id", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "account_ecotaxe_classification", "sector_id" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.ecotaxe.classification", | ||
"account_ecotaxe_classification", | ||
"ecotaxe_sector_id", | ||
"sector_id", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "account_ecotaxe_classification", "collector_id" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.ecotaxe.classification", | ||
"account_ecotaxe_classification", | ||
"ecotaxe_collector_id", | ||
"collector_id", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "account_ecotaxe_classification", "product_status" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.ecotaxe.classification", | ||
"account_ecotaxe_classification", | ||
"ecotaxe_product_status", | ||
"product_status", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "account_ecotaxe_classification", "supplier_status" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.ecotaxe.classification", | ||
"account_ecotaxe_classification", | ||
"ecotaxe_supplier_status", | ||
"supplier_status", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "account_ecotaxe_classification", "emebi_code" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.ecotaxe.classification", | ||
"account_ecotaxe_classification", | ||
"ecotaxe_deb_code", | ||
"emebi_code", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "account_ecotaxe_classification", "scale_code" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.ecotaxe.classification", | ||
"account_ecotaxe_classification", | ||
"ecotaxe_scale_code", | ||
"scale_code", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "account_move_line_ecotaxe", "classification_id" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.move.line.ecotaxe", | ||
"account_move_line_ecotaxe", | ||
"ecotaxe_classification_id", | ||
"classification_id", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "account_move_line_ecotaxe", "amount_unit" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.move.line.ecotaxe", | ||
"account_move_line_ecotaxe", | ||
"ecotaxe_amount_unit", | ||
"amount_unit", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "account_move_line_ecotaxe", "amount_total" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.move.line.ecotaxe", | ||
"account_move_line_ecotaxe", | ||
"ecotaxe_amount_total", | ||
"amount_total", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "account_move_line_ecotaxe", "force_amount_unit" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"account.move.line.ecotaxe", | ||
"account_move_line_ecotaxe", | ||
"force_ecotaxe_unit", | ||
"force_amount_unit", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists( | ||
env.cr, "ecotaxe_line_product", "classification_id" | ||
): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"ecotaxe.line.product", | ||
"ecotaxe_line_product", | ||
"ecotaxe_classification_id", | ||
"classification_id", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists(env.cr, "ecotaxe_line_product", "force_amount"): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"ecotaxe.line.product", | ||
"ecotaxe_line_product", | ||
"force_ecotaxe_amount", | ||
"force_amount", | ||
), | ||
], | ||
) | ||
if not openupgrade.column_exists(env.cr, "ecotaxe_line_product", "amount"): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
"ecotaxe.line.product", | ||
"ecotaxe_line_product", | ||
"ecotaxe_amount", | ||
"amount", | ||
), | ||
], | ||
) |
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
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
Oops, something went wrong.