diff --git a/openupgrade_scripts/apriori.py b/openupgrade_scripts/apriori.py index 1fcd37f0e328..7aff171782fc 100644 --- a/openupgrade_scripts/apriori.py +++ b/openupgrade_scripts/apriori.py @@ -79,6 +79,7 @@ "mrp_subcontracting_resupply_link": "mrp_subcontracting_purchase", # OCA/pos "pos_invoicing": "point_of_sale", + "pos_order_line_note": "point_of_sale", "pos_order_mgmt": "point_of_sale", "pos_order_return": "point_of_sale", "pos_sale_order_load": "pos_sale", diff --git a/openupgrade_scripts/scripts/point_of_sale/15.0.1.0.1/pre-migration.py b/openupgrade_scripts/scripts/point_of_sale/15.0.1.0.1/pre-migration.py index 465ad43fe009..f8a9222c61c7 100644 --- a/openupgrade_scripts/scripts/point_of_sale/15.0.1.0.1/pre-migration.py +++ b/openupgrade_scripts/scripts/point_of_sale/15.0.1.0.1/pre-migration.py @@ -28,9 +28,29 @@ def merge_pos_order_return_module(env): ) +def merge_pos_order_line_module(env): + """ + The OCA/pos_order_line_note module (V12) is now merged into point_of_sale. We can hook into + the new core functionality just renaming the proper field. + """ + if openupgrade.column_exists(env.cr, "pos_order_line", "note"): + openupgrade.rename_fields( + env, + [ + ( + "pos.order.line", + "pos_order_line", + "note", + "customer_note", + ), + ], + ) + + @openupgrade.migrate() def migrate(env, version): merge_pos_order_return_module(env) + merge_pos_order_line_module(env) openupgrade.rename_fields( env, [