-
-
Notifications
You must be signed in to change notification settings - Fork 715
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] product_medical: Migration to 18.0
- Loading branch information
Lukas Tran
committed
Dec 23, 2024
1 parent
4215f74
commit cf0503e
Showing
17 changed files
with
91 additions
and
76 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,6 +61,7 @@ Contributors | |
- `Trobz <https://trobz.com>`__: | ||
|
||
- Dung Tran <[email protected]> | ||
- Nhan Tran <[email protected]> | ||
|
||
Other credits | ||
------------- | ||
|
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 was deleted.
Oops, something went wrong.
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,42 @@ | ||
# Copyright 2024 Simone Rubino - Aion Tech | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from openupgradelib import openupgrade | ||
|
||
MODEL_TO_RENAMED_FIELDS = { | ||
"product.template": [ | ||
("ppe_category_id", "medical_ppe_category_id"), | ||
("in_vitro_diagnostic", "medical_in_vitro_diagnostic"), | ||
("in_vitro_diagnostic", "medical_in_vitro_diagnostic"), | ||
("conformity_declaration_ids", "medical_conformity_declaration_ids"), | ||
("doc_lot_related", "medical_doc_lot_related"), | ||
("doc_validity_date", "medical_doc_validity_date"), | ||
( | ||
"ce_certificate_medical_class_ids", | ||
"medical_ce_certificate_class_ids", | ||
), | ||
("ce_certificate_validity_date", "medical_ce_certificate_validity_date"), | ||
("notified_body_id", "medical_notified_body_id"), | ||
] | ||
} | ||
|
||
|
||
def _rename_fields(env): | ||
openupgrade.rename_fields( | ||
env, | ||
[ | ||
( | ||
model_name, | ||
env[model_name]._table, | ||
field_spec[0], | ||
field_spec[1], | ||
) | ||
for model_name, field_specs in MODEL_TO_RENAMED_FIELDS.items() | ||
for field_spec in field_specs | ||
], | ||
) | ||
|
||
|
||
@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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
- Iryna Vyshnevska, Camptocamp | ||
- [Trobz](https://trobz.com): | ||
- Dung Tran \<<[email protected]>\> | ||
- Nhan Tran \<<[email protected]>\> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# generated from manifests external_dependencies | ||
openupgradelib |