Bug check qt
This commit is contained in:
@@ -1751,11 +1751,19 @@ class Line(metaclass=PoolMeta):
|
||||
|
||||
if free_lqts:
|
||||
lqt = free_lqts[0]
|
||||
if Decimal(lqt.lot_quantity or 0) != free_quantity:
|
||||
lqt.lot_quantity = free_quantity
|
||||
with Transaction().set_context(
|
||||
_purchase_trade_skip_quantity_consistency=True):
|
||||
LotQt.save([lqt])
|
||||
logger.info(
|
||||
"PURCHASE_QTY_SYNC_FREE_BEFORE lqt=%s quantity=%s new=%s",
|
||||
getattr(lqt, 'id', None),
|
||||
getattr(lqt, 'lot_quantity', None),
|
||||
free_quantity)
|
||||
lqt.lot_quantity = free_quantity
|
||||
with Transaction().set_context(
|
||||
_purchase_trade_skip_quantity_consistency=True):
|
||||
LotQt.save([lqt])
|
||||
logger.info(
|
||||
"PURCHASE_QTY_SYNC_FREE_AFTER lqt=%s quantity=%s",
|
||||
getattr(lqt, 'id', None),
|
||||
getattr(LotQt(getattr(lqt, 'id')), 'lot_quantity', None))
|
||||
elif free_quantity > 0:
|
||||
lqt = LotQt()
|
||||
lqt.lot_p = vlot.id
|
||||
|
||||
@@ -1865,11 +1865,19 @@ class SaleLine(metaclass=PoolMeta):
|
||||
|
||||
if free_lqts:
|
||||
lqt = free_lqts[0]
|
||||
if Decimal(lqt.lot_quantity or 0) != free_quantity:
|
||||
lqt.lot_quantity = free_quantity
|
||||
with Transaction().set_context(
|
||||
_purchase_trade_skip_quantity_consistency=True):
|
||||
LotQt.save([lqt])
|
||||
logger.info(
|
||||
"SALE_QTY_SYNC_FREE_BEFORE lqt=%s quantity=%s new=%s",
|
||||
getattr(lqt, 'id', None),
|
||||
getattr(lqt, 'lot_quantity', None),
|
||||
free_quantity)
|
||||
lqt.lot_quantity = free_quantity
|
||||
with Transaction().set_context(
|
||||
_purchase_trade_skip_quantity_consistency=True):
|
||||
LotQt.save([lqt])
|
||||
logger.info(
|
||||
"SALE_QTY_SYNC_FREE_AFTER lqt=%s quantity=%s",
|
||||
getattr(lqt, 'id', None),
|
||||
getattr(LotQt(getattr(lqt, 'id')), 'lot_quantity', None))
|
||||
elif free_quantity > 0:
|
||||
lqt = LotQt()
|
||||
lqt.lot_p = None
|
||||
|
||||
Reference in New Issue
Block a user