[Erp5-report] r12592 - /erp5/trunk/products/ERP5/Document/Movement.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Feb 9 11:29:07 CET 2007
Author: romain
Date: Fri Feb 9 11:29:05 2007
New Revision: 12592
URL: http://svn.erp5.org?rev=12592&view=rev
Log:
Use isinstance instead of type.
Modified:
erp5/trunk/products/ERP5/Document/Movement.py
Modified: erp5/trunk/products/ERP5/Document/Movement.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Movement.py?rev=12592&r1=12591&r2=12592&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Movement.py (original)
+++ erp5/trunk/products/ERP5/Document/Movement.py Fri Feb 9 11:29:05 2007
@@ -205,8 +205,8 @@
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
More information about the Erp5-report
mailing list