Skip to content

Commit

Permalink
[15.0][OU-ADD] pos_order_return: Merged in point_of_sale
Browse files Browse the repository at this point in the history
TT45179

The OCA module pos_order_return allows the user to partially return a
sale_order in the frontend, and also links this refunds with their
original orders. From Odoo v15 we can do this in core from the frontend
and those links are paired to the ones we were providing.
One thing that adds this module that isn't in core is a boolean indicating
if you want to allow negative quantities on the POS for products.
This feature can be discussed if it is worth it to be conserved
in a custom module or not as it was a little out of context anyway.
  • Loading branch information
stefan-tecnativa committed Oct 25, 2023
1 parent dbb7056 commit 9870b5c
Show file tree
Hide file tree
Showing 2 changed files with 30 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,36 @@
from openupgradelib import openupgrade


def merge_pos_order_return_module(env):
"""
pos_order_return merged into point_of_sale. At this stage the module
is already merged. So to ensure that the module is installed we can
check if any of the columns that the OCA module adds exists at this
moment.
"""
if openupgrade.column_exist(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 9870b5c

Please sign in to comment.