Commit b34a6314 authored by Łukasz Nowak's avatar Łukasz Nowak

- factorise reindexation of subobjects when parent is indexed by using Interactor


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36994 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 13bef144
......@@ -74,14 +74,6 @@ class Container(Movement, XMLObject):
, PropertySheet.SortIndex
)
def reindexObject(self, *args, **kw):
"""Reindex container and children
Children must be reindexed because PackingList.isPacked use the catalog
to find them.
"""
self.recursiveReindexObject(*args, **kw)
security.declareProtected(Permissions.AccessContentsInformation,
'getQuantity')
def getQuantity(self, default=1.0):
......
......@@ -466,17 +466,6 @@ class Delivery(XMLObject, ImmobilisationDelivery, CompositionMixin):
movement_relative_url_list=detached_movement_url_list)
#######################################################
# Defer indexing process
def reindexObject(self, *k, **kw):
"""
Reindex children and simulation
"""
self.recursiveReindexObject(*k, **kw)
# NEW: we never rexpand simulation - This is a task for DSolver / TSolver
# Make sure expanded simulation is still OK (expand and reindex)
# self.activate().applyToDeliveryRelatedMovement(method_id = 'expand')
#######################################################
# Stock Management
def _getMovementResourceList(self):
......
......@@ -240,10 +240,6 @@ class DeliveryLine(Movement, XMLObject, XMLMatrix, Variated,
# And apply
getattr(my_simulation_movement.getObject(), method_id)()
def reindexObject(self, *k, **kw):
"""Reindex children"""
self.recursiveReindexObject(*k, **kw)
security.declareProtected(Permissions.AccessContentsInformation, 'getInventoriatedQuantity')
def getInventoriatedQuantity(self):
"""
......
......@@ -38,6 +38,15 @@ class RecursiveReindexInteractor(Interactor):
from Products.ERP5.Document.TradeCondition import TradeCondition
self.on(TradeCondition.reindexObject).doAfter(self.recursiveReindexObject)
from Products.ERP5.Document.Delivery import Delivery
self.on(Delivery.reindexObject).doAfter(self.recursiveReindexObject)
from Products.ERP5.Document.Container import Container
self.on(Container.reindexObject).doAfter(self.recursiveReindexObject)
from Products.ERP5.Document.DeliveryLine import DeliveryLine
self.on(DeliveryLine.reindexObject).doAfter(self.recursiveReindexObject)
def recursiveReindexObject(self, method_call_object, *args, **kw):
"""
Reindex content inside
......
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