changeset 72fb25e40b43 in modules/account_stock_shipment_cost_weight:default
details:
https://hg.tryton.org/modules/account_stock_shipment_cost_weight?cmd=changeset&node=72fb25e40b43
description:
Store allocation factors per model name and id
This avoid collision if different shipment models have the same id.
issue11559
review443231004
diffstat:
account.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (14 lines):
diff -r cd4fd03c3fe0 -r 72fb25e40b43 account.py
--- a/account.py Mon May 02 17:57:17 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