Bug Create contract

This commit is contained in:
2026-05-14 16:54:32 +02:00
parent a613f59a2d
commit cdfc117220

View File

@@ -331,8 +331,19 @@ class ContractFactory:
lqh.gross_quantity = round(lot.lot_quantity, 5)
lot.lot_hist = [lqh]
with Transaction().set_context(
_purchase_trade_skip_quantity_consistency=True):
logger.info(
"CREATE_CONTRACT_LOT_BEFORE_SAVE type=%s line=%s qty=%s "
"source_lot=%s source_lqt=%s shipment=%s skip_before=%s",
type_,
getattr(line, 'id', None),
getattr(lot, 'lot_quantity', None),
getattr(source.get('lot'), 'id', None),
getattr(source.get('lqt'), 'id', None),
source.get('shipment_origin'),
Transaction().context.get(
'_purchase_trade_skip_quantity_consistency'))
with Lot.skip_quantity_consistency():
lot.save()
logger.info(
"CREATE_CONTRACT_LOT_SAVED type=%s line=%s lot=%s qty=%s "