get rid of purpose migration in fsm_equipment to fix migration bug
This commit is contained in:
parent
7a11a8fef5
commit
77cd7eba40
1 changed files with 0 additions and 10 deletions
|
|
@ -15,22 +15,12 @@ def migrate(cr, version):
|
||||||
purposes = cr.dictfetchall()
|
purposes = cr.dictfetchall()
|
||||||
|
|
||||||
env = api.Environment(cr, SUPERUSER_ID, {})
|
env = api.Environment(cr, SUPERUSER_ID, {})
|
||||||
tags = env["fsm.equipment.tag"].create(
|
|
||||||
[{"name": purpose["name"]} for purpose in purposes]
|
|
||||||
)
|
|
||||||
|
|
||||||
purpose_dict = {
|
|
||||||
purpose["id"]: tags.filtered(lambda tag: tag.name == purpose["name"]).id
|
|
||||||
for purpose in purposes
|
|
||||||
}
|
|
||||||
|
|
||||||
_logger.info(f"purpose_dict: {purpose_dict}")
|
|
||||||
env["fsm.equipment"].create(
|
env["fsm.equipment"].create(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"name": component["name"],
|
"name": component["name"],
|
||||||
"sequence": component["sequence"],
|
"sequence": component["sequence"],
|
||||||
"tag_ids": [Command.link(purpose_dict[component["purpose_id"]])],
|
|
||||||
"parent_id": component["equipment_id"],
|
"parent_id": component["equipment_id"],
|
||||||
"description": component["note"],
|
"description": component["note"],
|
||||||
"product_id": component["product_id"],
|
"product_id": component["product_id"],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue