Skip to content

Commit

Permalink
Merge pull request #4191 from Tecnativa/15.0-mig-pos_order_return
Browse files Browse the repository at this point in the history
[15.0][OU-ADD] pos_order_return: Merged in point_of_sale
  • Loading branch information
pedrobaeza committed Oct 25, 2023
2 parents dbb7056 + b0ecf0e commit 27c8eeb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openupgrade_scripts/apriori.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@
"website_sale_stock_available_display": "website_sale_stock",
# OCA/hr-attendance
"hr_attendance_user_list": "hr_attendance",
# OCA/pos
"pos_order_return": "point_of_sale",
# OCA/product-attribute
"stock_account_product_cost_security": "product_cost_security",
# OCA/stock-logistics-reporting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,34 @@
from openupgradelib import openupgrade


def merge_pos_order_return_module(env):
"""
The pos_order_return module is now merged into point_of_sale. We can hook into
the new core functionality just renaming the proper fields.
"""
if openupgrade.column_exists(env.cr, "pos_order", "returned_order_id"):
openupgrade.rename_fields(
env,
[
(
"pos.order.line",
"pos_order_line",
"returned_line_id",
"refunded_orderline_id",
),
(
"pos.order.line",
"pos_order_line",
"refund_line_ids",
"refund_orderline_ids",
),
],
)


@openupgrade.migrate()
def migrate(env, version):
merge_pos_order_return_module(env)
openupgrade.rename_fields(
env,
[
Expand Down

0 comments on commit 27c8eeb

Please sign in to comment.