Commit a4cf1deb authored by Nicolas Dumazet's avatar Nicolas Dumazet

_aq_reset is now only a subset of resetDynamicDocuments:

we need to update generated portal types as well


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42728 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1f10f61b
...@@ -35,7 +35,6 @@ from Products.DCWorkflow.Expression import Expression ...@@ -35,7 +35,6 @@ from Products.DCWorkflow.Expression import Expression
from Products.DCWorkflow.Transitions import TRIGGER_WORKFLOW_METHOD from Products.DCWorkflow.Transitions import TRIGGER_WORKFLOW_METHOD
from Products.ERP5 import _dtmldir from Products.ERP5 import _dtmldir
from Products.ERP5Type.Base import _aq_reset
class InteractionDefinition (SimpleItem): class InteractionDefinition (SimpleItem):
meta_type = 'Workflow Interaction' meta_type = 'Workflow Interaction'
...@@ -164,8 +163,8 @@ class InteractionDefinition (SimpleItem): ...@@ -164,8 +163,8 @@ class InteractionDefinition (SimpleItem):
self.actbox_name = str(actbox_name) self.actbox_name = str(actbox_name)
self.actbox_url = str(actbox_url) self.actbox_url = str(actbox_url)
self.actbox_category = str(actbox_category) self.actbox_category = str(actbox_category)
# reset _aq_dynamic method cache. # reset cached methods
_aq_reset() self.getPortalObject().portal_types.resetDynamicDocuments()
if REQUEST is not None: if REQUEST is not None:
return self.manage_properties(REQUEST, 'Properties changed.') return self.manage_properties(REQUEST, 'Properties changed.')
......
...@@ -28,31 +28,33 @@ ...@@ -28,31 +28,33 @@
############################################################################## ##############################################################################
from Products.ERP5Type.Interactor.Interactor import Interactor from Products.ERP5Type.Interactor.Interactor import Interactor
from Products.ERP5Type.Base import _aq_reset
class AqDynamicInteractor(Interactor): class PortalTypeClassInteractor(Interactor):
""" """
This interactor handles all the calls to _aq_dynamic This interactor handles all the calls to resetDynamicDocuments
which must be trigerred whenever some parts of ERP5 which must be trigered whenever some parts of ERP5
are modified and require to generate again accessors are modified and require to generate again accessors
and dynamic properties. and dynamic properties.
""" """
def install(self): def install(self):
from Products.CMFCore.WorkflowTool import WorkflowTool from Products.CMFCore.WorkflowTool import WorkflowTool
self.on(WorkflowTool.manage_changeWorkflows).doAfter(self.resetAqDynamic) self.on(WorkflowTool.manage_changeWorkflows).doAfter(self.resetDynamic)
from Products.DCWorkflow.Transitions import Transitions from Products.DCWorkflow.Transitions import Transitions
self.on(Transitions.addTransition).doAfter(self.resetAqDynamic) self.on(Transitions.addTransition).doAfter(self.resetDynamic)
self.on(Transitions.deleteTransitions).doAfter(self.resetAqDynamic) self.on(Transitions.deleteTransitions).doAfter(self.resetDynamic)
from Products.DCWorkflow.Transitions import TransitionDefinition from Products.DCWorkflow.Transitions import TransitionDefinition
self.on(TransitionDefinition.setProperties).doAfter(self.resetAqDynamic) self.on(TransitionDefinition.setProperties).doAfter(self.resetDynamic)
from Products.DCWorkflow.Variables import Variables from Products.DCWorkflow.Variables import Variables
self.on(Variables.setStateVar).doAfter(self.resetAqDynamic) self.on(Variables.setStateVar).doAfter(self.resetDynamic)
from Products.Localizer.Localizer import Localizer from Products.Localizer.Localizer import Localizer
self.on(Localizer.add_language).doAfter(self.resetAqDynamic) self.on(Localizer.add_language).doAfter(self.resetDynamic)
self.on(Localizer.del_language).doAfter(self.resetAqDynamic) self.on(Localizer.del_language).doAfter(self.resetDynamic)
def resetAqDynamic(self, *args, **kw): def resetDynamic(self, method_call_object, *args, **kw):
""" """
Reset _aq_dynamic Call resetDynamicDocuments
""" """
_aq_reset() portal = method_call_object.instance.getPortalObject()
types_tool = getattr(portal, 'portal_types', None)
if types_tool is not None:
types_tool.resetDynamicDocuments()
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