From 24843ab72d3a83eef1780a1cf4f2aca659b15780 Mon Sep 17 00:00:00 2001 From: laurentbarontini Date: Tue, 3 Feb 2026 19:33:01 +0100 Subject: [PATCH] 03.02.26 --- modules/automation/automation.py | 2 +- modules/automation/cron.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/automation/automation.py b/modules/automation/automation.py index 870eda5..3390b47 100644 --- a/modules/automation/automation.py +++ b/modules/automation/automation.py @@ -246,7 +246,7 @@ class AutomationDocument(ModelSQL, ModelView, Workflow): "gross_weight": float(round(lot.lot_gross_quantity / factor,5)), "net_weight": float(round(lot.lot_quantity / factor,5)), "tare_total": float(round(wr.tare_kg * (lot.lot_quantity / weight_total),5)) , - "bags": int(wr.bales * (lot.lot_quantity / weight_total)), + "bags": int(lot.lot_qt), "surveyor_code": 231, "place_key": 0, "report_date": 20260127 diff --git a/modules/automation/cron.py b/modules/automation/cron.py index 2b69000..a9e4f5a 100644 --- a/modules/automation/cron.py +++ b/modules/automation/cron.py @@ -1,6 +1,6 @@ import requests from decimal import getcontext, Decimal, ROUND_HALF_UP -from datetime import datetime +from datetime import datetime, timedelta from trytond.model import fields from trytond.model import ModelSQL, ModelView from trytond.pool import Pool, PoolMeta @@ -305,6 +305,7 @@ class AutomationCron(ModelSQL, ModelView): shipment.bl_number = bl_number shipment.bl_date = bl_date shipment.etd = etd_date + shipment.eta = bl_date + timedelta(days=20) # Sauvegarder ce shipment uniquement ShipmentIn.save([shipment])