Bug Create contract

This commit is contained in:
2026-05-14 17:11:54 +02:00
parent 18c0329a94
commit 160ec1544b
6 changed files with 101 additions and 77 deletions

View File

@@ -880,6 +880,9 @@ class Lot(metaclass=PoolMeta):
lqt = LotQt.search([('lot_p','=',lot.id)])
if len(lqt)==0 and not lot.line.created_by_code:
lot.createVirtualPart(lot.lot_quantity,None,None)
# Wizard-created matched lines attach/split lot.qt after
# the virtual lot save; the final workflow check covers
# the complete state.
if not lot.line.created_by_code:
virtual_lots_to_check.append(lot)
@@ -887,6 +890,8 @@ class Lot(metaclass=PoolMeta):
lqt = LotQt.search([('lot_s','=',lot.id)])
if len(lqt)==0 and not lot.sale_line.created_by_code:
lot.createVirtualPart(lot.lot_quantity,None,lot.id,'only sale')
# Same rule as purchase side: do not check the transient
# save of a virtual lot created by matching code.
if not lot.sale_line.created_by_code:
virtual_lots_to_check.append(lot)