From d7517455f1c1c99ab4896717edfb6322b46e00dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Fri, 8 Mar 2024 17:17:09 +0100 Subject: [PATCH] [OU-ADD] purchase_requisition_stock: purchase_requisition_grouped_by_procurement compatibility Rename group_id column from purchase.requisition to procurement_group_id TT41760 --- .../15.0.1.2/pre-migration.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 openupgrade_scripts/scripts/purchase_requisition_stock/15.0.1.2/pre-migration.py diff --git a/openupgrade_scripts/scripts/purchase_requisition_stock/15.0.1.2/pre-migration.py b/openupgrade_scripts/scripts/purchase_requisition_stock/15.0.1.2/pre-migration.py new file mode 100644 index 000000000000..fe795fa593e7 --- /dev/null +++ b/openupgrade_scripts/scripts/purchase_requisition_stock/15.0.1.2/pre-migration.py @@ -0,0 +1,23 @@ +# Copyright 2024 Tecnativa - Víctor Martínez +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from openupgradelib import openupgrade + + +@openupgrade.migrate() +def migrate(env, version): + """The module purchase_requisition_grouped_by_procurement previously added + group_id column in previous version. Now procurement_group_id field exists.""" + if openupgrade.is_module_installed( + env.cr, "purchase_requisition_grouped_by_procurement" + ): + openupgrade.rename_fields( + env, + [ + ( + "purchase.requisition", + "purchase_requisition", + "group_id", + "procurement_group_id", + ), + ], + )