changeset d52c926ac8fd in modules/account_stock_shipment_cost_weight:6.4
details:
https://hg.tryton.org/modules/account_stock_shipment_cost_weight?cmd=changeset&node=d52c926ac8fd
description:
Store allocation factors per model name and id
This avoid collision if different shipment models have the same id.
issue11559
review443231004
(grafted from 72fb25e40b43e433f2a5b9c48d11c79edc80953d)
diffstat:
account.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (14 lines):
diff -r 24e4913c6706 -r d52c926ac8fd account.py
--- a/account.py Mon May 02 17:57:15 2022 +0200
+++ b/account.py Wed Jun 15 22:05:41 2022 +0200
@@ -29,8 +29,8 @@
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