Files
stock-logistics-warehouse/stock_move_packaging_qty/migrations/15.0.0/pre-migrate.py
Jairo Llopis a382f0eb3c [MIG] stock_move_packaging_qty: migrate to 16.0
- Code and DB migrations to use upstream field `product_packaging_id`, introduced in https://github.com/odoo/odoo/pull/68654.
- Test class moved to `post_install`, to let it pass if `sale_stock` is installed too.
- Satisfy new linters.

@moduon MT-3694
2023-08-28 11:39:57 +01:00

21 lines
659 B
Python

# Copyright 2023 Moduon Team S.L. <info@moduon.team>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from openupgradelib import openupgrade
def migrate(cr, version):
"""Use upstream column.
In https://github.com/odoo/odoo/pull/68654, upstream added product_packaging_id.
That feature is removed from this module and migrated there.
"""
if openupgrade.column_exists(cr, "stock_move", "product_packaging"):
openupgrade.rename_columns(
cr,
{
"stock_move": [
("product_packaging", "product_packaging_id"),
],
},
)