Commit 06b00e82 authored by Guillaume Michon's avatar Guillaume Michon

Added notifySimulationChange to notify deliveries


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2880 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f7b5c4a4
...@@ -174,8 +174,12 @@ An ERP5 Rule...""" ...@@ -174,8 +174,12 @@ An ERP5 Rule..."""
""" """
rule = self.getSpecialiseValue() rule = self.getSpecialiseValue()
if rule is not None: if rule is not None:
if self.isRootAppliedRule():
rule._v_notify_dict = {} # We should capture here a list of url/uids of deliveires to update
rule.expand(self,**kw) rule.expand(self,**kw)
if self.isRootAppliedRule():
self.activate(after_method_id="immediateReindexObject").notifySimulationChange(rule._v_notify_dict)
#expand = WorkflowMethod(expand) #expand = WorkflowMethod(expand)
security.declareProtected(Permissions.ModifyPortalContent, 'solve') security.declareProtected(Permissions.ModifyPortalContent, 'solve')
...@@ -302,4 +306,11 @@ An ERP5 Rule...""" ...@@ -302,4 +306,11 @@ An ERP5 Rule..."""
# Psyco optimizations # Psyco optimizations
psyco.bind(getMovementIndex) psyco.bind(getMovementIndex)
security.declareProtected(Permissions.ModifyPortalContent, 'notifySimulationChange')
def notifySimulationChange(self, notify_dict):
for delivery_url in notify_dict.keys():
delivery_value = self.getPortalObject().restrictedTraverse(delivery_url)
if delivery_value is None:
LOG("ERP5 WARNING", 0, 'Unable to access object %s to notify simulation change' % delivery_url)
else:
delivery_value.notifySimulationChange()
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