mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
The two modules have the same features, but the stock_restrict_lot is more used in other modules so changing the module used to match the OCA behavior.
19 lines
542 B
Python
19 lines
542 B
Python
# Copyright (C) 2025 ForgeFlow S.L.
|
|
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
|
|
|
from openupgradelib import openupgrade # pylint: disable=W7936
|
|
|
|
_field_renames = [
|
|
("stock.move", "stock_move", "forced_lot_id", "restrict_lot_id"),
|
|
]
|
|
|
|
|
|
@openupgrade.migrate()
|
|
def migrate(env, version):
|
|
cr = env.cr
|
|
for field in _field_renames:
|
|
if openupgrade.table_exists(cr, field[1]) and openupgrade.column_exists(
|
|
cr, field[1], field[2]
|
|
):
|
|
openupgrade.rename_fields(env, [field])
|