From 1a09c72be64cfae7169dd18ec370085c6cd9d98d Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 22 Feb 2019 19:50:07 +0100 Subject: [PATCH] Exclude lines without quantity when computing carrier context issue8108 review56601002 --- sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sale.py b/sale.py index 0c09caf576..99745564c1 100644 --- a/sale.py +++ b/sale.py @@ -28,7 +28,7 @@ class Sale(metaclass=PoolMeta): weights = [] context['weights'] = weights - lines = [l for l in self.lines or [] if l.quantity > 0] + lines = [l for l in self.lines or [] if l.quantity and l.quantity > 0] keyfunc = partial(self._group_parcel_key, lines) lines = sorted(lines, key=keyfunc)