[Erp5-report] r16120 - /erp5/trunk/products/ERP5Type/Base.py
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Sep 6 16:30:30 CEST 2007
Author: aurel
Date: Thu Sep 6 16:30:29 2007
New Revision: 16120
URL: http://svn.erp5.org?rev=16120&view=rev
Log:
rename isInventoryLine to isInventoryMovement
add method to define reindex_kw, it acts like activate_kw but for reindexing
Modified:
erp5/trunk/products/ERP5Type/Base.py
Modified: erp5/trunk/products/ERP5Type/Base.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5Type/Base.py?rev=16120&r1=16119&r2=16120&view=diff
==============================================================================
--- erp5/trunk/products/ERP5Type/Base.py (original)
+++ erp5/trunk/products/ERP5Type/Base.py Thu Sep 6 16:30:29 2007
@@ -672,10 +672,10 @@
isCapacity = 0 #
isCategory = 0 #
isBaseCategory = 0 #
+ isInventoryMovement = 0 #
isMovement = 0 #
isDelivery = 0 #
isInventory = 0 #
- isInventoryLine = 0 #
isIndexable = 1 # If set to 0, reindexing will not happen (useful for optimization)
isPredicate = 0 #
isTemplate = 0 #
@@ -2533,6 +2533,10 @@
if activate_kw is None:
activate_kw = {}
+ reindex_kw = self.getDefaultReindexParametersDict()
+ if reindex_kw is not None:
+ kw.update(reindex_kw)
+
group_id_list = []
if kw.get("group_id", "") not in ('', None):
group_id_list.append(kw.get("group_id", ""))
@@ -3299,6 +3303,24 @@
dochelper.setDynamicPropertyList(dynamic_property_list)
return dochelper
+
+ security.declareProtected(permissions.ModifyPortalContent, 'setDefaultReindexParameters' )
+ def setDefaultReindexParameters(self, **kw):
+ # This method sets the default keyword parameters to reindex. This is useful
+ # when you need to specify special parameters implicitly (e.g. to reindexObject).
+ tv = getTransactionalVariable(self)
+ key = ('default_reindex_parameter', id(aq_base(self)))
+ tv[key] = kw
+
+ security.declareProtected(permissions.View, 'getDefaultReindexParameterDict' )
+ def getDefaultReindexParametersDict(self):
+ # This method returns default reindex parameters to self.
+ # The result can be either a dict object or None.
+ tv = getTransactionalVariable(self)
+ key = ('default_reindex_parameter', id(aq_base(self)))
+ return tv.get(key)
+
+
InitializeClass(Base)
class TempBase(Base):
More information about the Erp5-report
mailing list