diff --git a/modules/purchase_trade/lot.py b/modules/purchase_trade/lot.py index 57ea718..a6712b1 100755 --- a/modules/purchase_trade/lot.py +++ b/modules/purchase_trade/lot.py @@ -1278,21 +1278,23 @@ class LotQt( LotQt = Pool().get('lot.qt') Lot = Pool().get('lot.lot') purchase = lqt.lot_p.line.purchase - lots = [] - tot_qt = 0 - for l in vlots: - lot,qt = lqt.add_physical_lot(l) - lots.append(lot) - tot_qt += qt - - #create move for lots - Purchase._process_shipment([purchase],lots) - - #update LotQt - lqt.lot_quantity -= round(tot_qt,5) - if lqt.lot_quantity < 0: - lqt.lot_quantity = 0 - LotQt.save([lqt]) + lots = [] + tot_qt = 0 + with Transaction().set_context( + _purchase_trade_skip_quantity_consistency=True): + for l in vlots: + lot,qt = lqt.add_physical_lot(l) + lots.append(lot) + tot_qt += qt + + #create move for lots + Purchase._process_shipment([purchase],lots) + + #update LotQt + lqt.lot_quantity -= round(tot_qt,5) + if lqt.lot_quantity < 0: + lqt.lot_quantity = 0 + LotQt.save([lqt]) affected_lines = [] if lqt.lot_p and lqt.lot_p.line: affected_lines.append(lqt.lot_p.line)