mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
- 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
21 lines
659 B
Python
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"),
|
|
],
|
|
},
|
|
)
|