[Erp5-report] r22725 - /erp5/trunk/products/ERP5/Extensions/InventoryBrain.py

nobody at svn.erp5.org nobody at svn.erp5.org
Tue Jul 29 16:41:15 CEST 2008


Author: nicolas
Date: Tue Jul 29 16:41:14 2008
New Revision: 22725

URL: http://svn.erp5.org?rev=22725&view=rev
Log:
Avoid calling portal_catalog for each brain

Modified:
    erp5/trunk/products/ERP5/Extensions/InventoryBrain.py

Modified: erp5/trunk/products/ERP5/Extensions/InventoryBrain.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Extensions/InventoryBrain.py?rev=22725&r1=22724&r2=22725&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Extensions/InventoryBrain.py (original)
+++ erp5/trunk/products/ERP5/Extensions/InventoryBrain.py Tue Jul 29 16:41:14 2008
@@ -290,7 +290,7 @@
   """
   List of aggregated movements
   """
-  def __init__(self):
+  def getDate(self):
     if not self.date:
       return
     # convert the date in the movement's original timezone.
@@ -302,7 +302,8 @@
       date = movement.getStartDate() or movement.getStopDate()
       if date is not None:
         timezone = date.timezone()
-        self.date = self.date.toZone(timezone)
+        return self.date.toZone(timezone)
+    return self.date
 
 class DeliveryListBrain(InventoryListBrain):
   """




More information about the Erp5-report mailing list