[Erp5-report] r37305 nicolas.dumazet - /erp5/trunk/products/ERP5/Document/Amount.py

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Jul 28 04:06:59 CEST 2010


Author: nicolas.dumazet
Date: Wed Jul 28 04:06:56 2010
New Revision: 37305

URL: http://svn.erp5.org?rev=37305&view=rev
Log:
getQuantityUnit: if category does not exist, return the path and not None

Modified:
    erp5/trunk/products/ERP5/Document/Amount.py

Modified: erp5/trunk/products/ERP5/Document/Amount.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/Amount.py?rev=37305&r1=37304&r2=37305&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/Amount.py [utf8] (original)
+++ erp5/trunk/products/ERP5/Document/Amount.py [utf8] Wed Jul 28 04:06:56 2010
@@ -733,8 +733,10 @@ class Amount(Base, Variated):
   security.declareProtected(Permissions.AccessContentsInformation,
       'getQuantityUnit')
   def getQuantityUnit(self):
-    value = self.getQuantityUnitValue()
-    if value is not None:
-      return value.getCategoryRelativeUrl()
-    return None
+    result = self._getDefaultCategoryMembership('quantity_unit')
+    if result is None:
+      resource = self.getResourceValue()
+      if resource is not None:
+        result = resource.getQuantityUnit()
+    return result
 




More information about the Erp5-report mailing list