Commit b4794e1e authored by Romain Courteaud's avatar Romain Courteaud

Use isinstance instead of type.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@12592 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 44960025
......@@ -205,8 +205,8 @@ class Movement(XMLObject, Amount):
def _getTotalPrice(self, default=None, context=None):
price = self.getPrice(context=context)
quantity = self.getQuantity()
if type(price) in (type(1.0), type(1)) and \
type(quantity) in (type(1.0), type(1)):
if isinstance(price, (int, float)) and \
isinstance(quantity, (int, float)):
return quantity * price
else:
return default
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment