Ensure quantity from context is a number

The quantity compares with other quantity so it fails on Python3 if quantity is None.

issue6885
review41641002
This commit is contained in:
Cédric Krier
2017-10-30 09:56:52 +01:00
parent 44d193dd30
commit 55ebc985b3
+1 -1
View File
@@ -104,7 +104,7 @@ class Product:
@classmethod
def get_purchase_price_uom(cls, products, name):
quantity = Transaction().context.get('quantity', 0)
quantity = Transaction().context.get('quantity') or 0
return cls.get_purchase_price(products, quantity=quantity)
@classmethod