Skip to content

Commit

Permalink
Merge pull request #3653 from Tecnativa/15.0-MIG-website_sale_stock_a…
Browse files Browse the repository at this point in the history
…vailable_display

[MIG] website_sale_stock_available_display: Migration to 15.0
  • Loading branch information
pedrobaeza authored Mar 9, 2023
2 parents 7c19b09 + 46715e7 commit 38f9175
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 2 additions & 0 deletions openupgrade_scripts/apriori.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
"website_sale_cart_no_redirect": "website_sale",
# OCA/hr
"hr_recruitment_notification": "hr_recruitment",
# OCA/e-commerce
"website_sale_stock_available_display": "website_sale_stock",
# OCA/hr-attendance
"hr_attendance_user_list": "hr_attendance",
# OCA/product-attribute
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ def migrate(env, version):
env.cr,
"""UPDATE product_template
SET allow_out_of_stock_order = CASE
WHEN inventory_availability IN ('never', 'custom')
THEN true ELSE false END, show_availability = CASE
WHEN inventory_availability IN ('always', 'threshold')
THEN true ELSE false END,
available_threshold = CASE WHEN inventory_availability = 'always'
THEN 999999999 END
WHEN inventory_availability IN ('never', 'custom', 'always_no_lock')
THEN true ELSE false END,
show_availability = CASE
WHEN inventory_availability IN ('always', 'threshold', 'always_no_lock')
THEN true ELSE false END,
available_threshold = CASE
WHEN inventory_availability IN ('always', 'always_no_lock')
THEN 999999999 END,
out_of_stock_message = CASE
WHEN inventory_availability = 'always_no_lock' THEN '0 Stock' END
""",
)

0 comments on commit 38f9175

Please sign in to comment.