Skip move with no quantity to allocate cost

This prevents a division by zero.

issue7229
review40181002
This commit is contained in:
Cédric Krier committed 2018-04-05 19:29:34 +02:00
1 parent 81f7646b85
commit 33ac928ad8
1 file changed
+1 -1
+1 -1
View File
@@ -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]