Skip to content

Commit

Permalink
Merge PR #1426 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by JordiBForgeFlow
  • Loading branch information
OCA-git-bot committed Oct 3, 2023
2 parents 0fc67c6 + a61099a commit 96a738a
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ def _move_max_weight(env):
"""
Move max_weight value to weight if not defined
"""
query = """
UPDATE product_packaging
SET weight = max_weight
WHERE weight IS NULL OR weight = 0.0
AND max_weight IS NOT NULL
AND product_id IS NOT NULL
"""
openupgrade.logged_query(env.cr, query)
if openupgrade.column_exists(env.cr, "product_packaging", "max_weight"):
query = """
UPDATE product_packaging
SET weight = max_weight
WHERE weight IS NULL OR weight = 0.0
AND max_weight IS NOT NULL
AND product_id IS NOT NULL
"""
openupgrade.logged_query(env.cr, query)


@openupgrade.migrate()
Expand Down

0 comments on commit 96a738a

Please sign in to comment.