Skip to content

Commit

Permalink
[IMP] product_packaging_level_salable: Add migration scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
duongtq committed Sep 19, 2023
1 parent 7347deb commit f4a45fb
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2023 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from openupgradelib import openupgrade


def _fill_in_columns(env):
if openupgrade.column_exists(env.cr, "product_packaging", "can_be_sold"):
query = """
UPDATE product_packaging
SET sales = can_be_sold
"""
openupgrade.logged_query(env.cr, query)


@openupgrade.migrate()
def migrate(env, version):
_fill_in_columns(env)

0 comments on commit f4a45fb

Please sign in to comment.