Commit 93c0e099 authored by Aurel's avatar Aurel

rename isInventoryLine to isInventoryMovement

add method to define reindex_kw, it acts like activate_kw but for reindexing


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16120 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a66edf2e
...@@ -672,10 +672,10 @@ class Base( CopyContainer, ...@@ -672,10 +672,10 @@ class Base( CopyContainer,
isCapacity = 0 # isCapacity = 0 #
isCategory = 0 # isCategory = 0 #
isBaseCategory = 0 # isBaseCategory = 0 #
isInventoryMovement = 0 #
isMovement = 0 # isMovement = 0 #
isDelivery = 0 # isDelivery = 0 #
isInventory = 0 # isInventory = 0 #
isInventoryLine = 0 #
isIndexable = 1 # If set to 0, reindexing will not happen (useful for optimization) isIndexable = 1 # If set to 0, reindexing will not happen (useful for optimization)
isPredicate = 0 # isPredicate = 0 #
isTemplate = 0 # isTemplate = 0 #
...@@ -2533,6 +2533,10 @@ class Base( CopyContainer, ...@@ -2533,6 +2533,10 @@ class Base( CopyContainer,
if activate_kw is None: if activate_kw is None:
activate_kw = {} activate_kw = {}
reindex_kw = self.getDefaultReindexParametersDict()
if reindex_kw is not None:
kw.update(reindex_kw)
group_id_list = [] group_id_list = []
if kw.get("group_id", "") not in ('', None): if kw.get("group_id", "") not in ('', None):
group_id_list.append(kw.get("group_id", "")) group_id_list.append(kw.get("group_id", ""))
...@@ -3299,6 +3303,24 @@ class Base( CopyContainer, ...@@ -3299,6 +3303,24 @@ class Base( CopyContainer,
dochelper.setDynamicPropertyList(dynamic_property_list) dochelper.setDynamicPropertyList(dynamic_property_list)
return dochelper 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) InitializeClass(Base)
class TempBase(Base): class TempBase(Base):
......
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