mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
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
29 lines
591 B
Python
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)
|