Commit 77564f93 authored by Rafael Monnerat's avatar Rafael Monnerat

Implement Before script execution.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42092 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 95eef085
......@@ -63,7 +63,7 @@ class Transition(XMLObject):
Execute transition.
"""
# Call the before script
#self._executeBeforeScript(document)
self._executeBeforeScript(document)
# Modify the state
self._changeState(document)
......@@ -125,6 +125,18 @@ class Transition(XMLObject):
script = getattr(document, script_id)
script(**form_kw)
def _executeBeforeScript(self, document, form_kw=None):
"""
Execute pre transition script.
"""
if form_kw is None:
form_kw = {}
script_id = self.getBeforeScriptId()
if script_id is not None:
import pdb;pdb.set_trace()
script = getattr(document, script_id)
script(**form_kw)
def _checkPermission(self, document):
"""
Check if transition is allowed.
......
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