Store allocation factors per model name and id
This avoid collision if different shipment models have the same id. issue11559 review443231004
This commit is contained in:
1 parent
48ef0ebe27
commit
c4e650df53
1 file changed
+2
-2
+2
-2
@@ -29,8 +29,8 @@ class ShipmentCost(metaclass=PoolMeta):
|
||||
factors = {}
|
||||
for shipment in shipments:
|
||||
if not sum_weight:
|
||||
factors[str(shipment.id)] = 1 / length
|
||||
factors[str(shipment)] = 1 / length
|
||||
else:
|
||||
factors[str(shipment.id)] = (
|
||||
factors[str(shipment)] = (
|
||||
Decimal(shipment.weight or 0) / sum_weight)
|
||||
return factors
|
||||
Reference in new issue
Block a user