From 221f5fb59b37184372ba78fc765925758f5c0579 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Benoi=CC=82t=20Pin?= Date: Mon, 1 Sep 2014 17:24:45 +0200 Subject: [PATCH] =?utf8?q?Bugfix=C2=A0:=20reduce=20non=20homog=C3=A8ne.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- order.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/order.py b/order.py index 66d17fa..db19cc0 100755 --- a/order.py +++ b/order.py @@ -337,12 +337,12 @@ class PrintOrder(PortalContent, DefaultDublinCoreImpl) : } if len(self.items) > 1 : - quantitySum = reduce(lambda a, b : a['quantity'] + b['quantity'], self.items) + quantitySum = reduce(lambda a, b : a + b, [item['quantity'] for item in self.items]) else : quantitySum = self.items[0]['quantity'] total = round(self.amountWithFees.getValues()['taxed'], 2) - options['L_PAYMENTREQUEST_0_NAME0'] = 'Commande realis photo ref. %s' % self.getId() + options['L_PAYMENTREQUEST_0_NAME0'] = 'Commande photo ref. %s' % self.getId() if quantitySum == 1 : options['L_PAYMENTREQUEST_0_DESC0'] = "Commande d'un tirage photographique" else : -- 2.20.1