This commit is contained in:
2026-03-10 21:18:19 +01:00
parent faf5fa605e
commit dee1896a6c

View File

@@ -804,7 +804,8 @@ class ShipmentIn(metaclass=PoolMeta):
"FeeUnitPrice": float(fee.price), "FeeUnitPrice": float(fee.price),
"ContractNumbers": sh.number, "ContractNumbers": sh.number,
"OrderQuantityGW": float(sh.get_quantity()) if sh.get_quantity() else float(1), "OrderQuantityGW": float(sh.get_quantity()) if sh.get_quantity() else float(1),
"NumberOfPackingBales": int(fee.quantity) if fee.quantity else int(1) "NumberOfPackingBales": int(fee.quantity) if fee.quantity else int(1),
"ChunkKeyList": sh.get_chunk_key()
} }
logger.info("PAYLOAD:%s",so_payload) logger.info("PAYLOAD:%s",so_payload)
@@ -857,6 +858,10 @@ class ShipmentIn(metaclass=PoolMeta):
def default_dashboard(cls): def default_dashboard(cls):
return 1 return 1
def get_chunk_key(self):
keys = [m.lot.lot_chunk_key for m in self.incoming_moves if m.lot]
return ",".join(map(str, keys)) if keys else None
def get_quantity(self,name=None): def get_quantity(self,name=None):
if self.incoming_moves: if self.incoming_moves:
return sum([(e.quantity if e.quantity else 0) for e in self.incoming_moves]) return sum([(e.quantity if e.quantity else 0) for e in self.incoming_moves])