Faircot cron

This commit is contained in:
2026-07-19 21:59:22 +02:00
parent a94f36e26f
commit bd72f8cef3
3 changed files with 204 additions and 99 deletions

View File

@@ -1014,9 +1014,8 @@ class Lot(metaclass=PoolMeta):
else:
lqt.lot_s = lot_s
lqt.lot_p = None
if sh:
logger.info("IDSHIP:%s",sh)
str_sh = str(sh)
if sh:
str_sh = str(sh)
index = str_sh.rfind(",")
if index != -1:
id = int(str_sh[index+1:].strip())
@@ -1059,10 +1058,8 @@ class Lot(metaclass=PoolMeta):
lqts = LotQt.search([('lot_p','=',vlot),('lot_shipment_out','=',id),('lot_s','=',lot_s)])
else:
lqts = LotQt.search([('lot_p','=',vlot),('lot_s','=',lot_s),('lot_shipment_in','=',None),('lot_shipment_internal','=',None),('lot_shipment_out','=',None)])
if lqts:
logger.info("UVP_QT:%s",qt)
logger.info("UVP_LQ:%s",lqts[0].lot_quantity)
lqts[0].lot_quantity += qt
if lqts:
lqts[0].lot_quantity += qt
if lqts[0].lot_quantity < 0:
lqts[0].lot_quantity = 0
LotQt.save(lqts)