From 870f2e93f40ea23d977690f080a3fd76d39d7047 Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Tue, 27 Jan 2026 16:45:55 +0100 Subject: [PATCH] 27.01.26 --- modules/automation/automation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/automation/automation.py b/modules/automation/automation.py index 3fdf9de..55d1f9d 100644 --- a/modules/automation/automation.py +++ b/modules/automation/automation.py @@ -244,11 +244,11 @@ class AutomationDocument(ModelSQL, ModelView, Workflow): Uom = Pool().get('product.uom') Sale = Pool().get('sale.sale') SaleLine = Pool().get('sale.line') - dec_key = str(row[16]).strip() lot_unit = str(row[5]).strip().lower() product = str(row[6]).strip().upper() lot_net_weight = Decimal(row[4]) + logger.info("LOT_NET_WEIGHT:%s",lot_net_weight) lot_gross_weight = Decimal(row[3]) lot_bales = int(row[2]) lot_number = row[1] @@ -265,9 +265,9 @@ class AutomationDocument(ModelSQL, ModelView, Workflow): logger.info("WITH_DEC:%s",sale_line) vlot = sale_line.lots[0] lqt = LotQt.search([('lot_s','=',vlot.id)]) - if lqt: - lqt[0].lot_s.updateVirtualPart(round(lot_net_weight,2),sh[0],lqt[0].lot_s,'only sale') - logger.info("WITH_DEC_LOT_NET:%s",lot_net_weight) + if lqt and lqt[0].lot_p: + logger.info("VLOT_P:%s",lqt[0].lot_p) + lqt[0].lot_p.updateVirtualPart(round(lot_net_weight,2),sh[0],lqt[0].lot_s) else: sale = Sale() sale_line = SaleLine()