Files
stock-rma/rma/migrations/16.0.1.1.0/post-migration.py
Jordi Ballester Alomar a9ac985b95 [IMP] introduce fields in_force_same_lot and out_force_same_lot
Those fields in the rma.operation allows us to control if we want to ensure that the
same lot as the one indicated in the RMA should be used in deliveries to customers
and receipts from suppliers
2024-05-09 20:05:33 +02:00

29 lines
591 B
Python

# Copyright 2024 ForgeFlow S.L. (https://www.forgeflow.com)
import logging
_logger = logging.getLogger(__name__)
def _update_rma_operations(cr):
_logger.info(
"Updating rma operations to preset in_force_same_lot and out_force_same_lot"
)
cr.execute(
"""
UPDATE rma_operation
SET in_force_same_lot=True
WHERE type='customer';
"""
)
cr.execute(
"""
UPDATE rma_operation
SET out_force_same_lot=True
WHERE type='supplier';
"""
)
def migrate(cr, version):
_update_rma_operations(cr)