From 33ac928ad84755dccc1f1045a10d598ebc02b91a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Thu, 5 Apr 2018 19:29:34 +0200 Subject: [PATCH] Skip move with no quantity to allocate cost This prevents a division by zero. issue7229 review40181002 --- account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account.py b/account.py index a0dd335657..d3f481daa9 100644 --- a/account.py +++ b/account.py @@ -237,7 +237,7 @@ class LandedCost(Workflow, ModelSQL, ModelView): cost = self.cost currency = self.company.currency moves = [m for s in self.shipments for m in s.incoming_moves - if m.state != 'cancel'] + if m.state != 'cancel' and m.quantity] costs = [] digit = Move.unit_price.digits[1]