This commit is contained in:
2026-01-27 18:21:00 +01:00
parent 9db6d2cb45
commit aa10a58b60

View File

@@ -347,18 +347,19 @@ class AutomationDocument(ModelSQL, ModelView, Workflow):
)
#Lots creation
# vlot = sale_line.lots[0]
# lqt = LotQt.search([('lot_s','=',vlot.id)])
# if lqt and vlot.lot_quantity > 0:
# lqt = lqt[0]
# l = LotAdd()
# l.lot_qt = lot_bales
# l.lot_unit = Uom.get_by_name('bale')
# l.lot_unit_line = lot_unit
# l.lot_quantity = round(lot_net_weight,2)
# l.lot_gross_quantity = round(lot_gross_weight,2)
# l.lot_premium = premium
# LotQt.add_physical_lots(lqt,[l])
vlot = sale_line.lots[0]
lqt = LotQt.search([('lot_s','=',vlot.id),('lot_p','>',0)])
if lqt and vlot.lot_quantity > 0:
lqt = lqt[0]
l = LotAdd()
l.lot_qt = lot_bales
l.lot_unit = Uom.get_by_name('bale')
l.lot_unit_line = lot_unit
l.lot_quantity = round(lot_net_weight,2)
l.lot_gross_quantity = round(lot_gross_weight,2)
l.lot_premium = premium
logger.info("ADD_LOT:%s",l)
LotQt.add_physical_lots(lqt,[l])