diff --git a/shipment.py b/shipment.py index 3882dd5..4f7998d 100644 --- a/shipment.py +++ b/shipment.py @@ -119,7 +119,8 @@ class ShipmentOut(metaclass=PoolMeta): weight = 1 if api.weight and hasattr(shipment, 'manual_weight'): weight = shipment.manual_weight or shipment.weight - weight = 1 if weight == 0.0 else weight + if not weight: + weight = 1 if api.weight_api_unit: if shipment.weight_uom: @@ -129,7 +130,7 @@ class ShipmentOut(metaclass=PoolMeta): weight = Uom.compute_qty( api.weight_unit, weight, api.weight_api_unit) - # weight is integer value, not float + # weight must integer value, not float weight = int(round(weight)) weight = 1 if weight == 0 else weight