Commit fe41e41c authored by Yoshinori Okuji's avatar Yoshinori Okuji

portal_workflow was not always obtained.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4154 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d411c357
...@@ -196,21 +196,22 @@ class CopyContainer: ...@@ -196,21 +196,22 @@ class CopyContainer:
# Add info about copy to edit workflow # Add info about copy to edit workflow
REQUEST = get_request() REQUEST = get_request()
if REQUEST is not None and REQUEST.get('__cp', None) : if REQUEST is not None and REQUEST.get('__cp', None) :
pw = self.restrictedTraverse("portal_workflow") pw = getToolByName(self, 'portal_workflow')
copied_item_list = _cb_decode(REQUEST['__cp'])[1] copied_item_list = _cb_decode(REQUEST['__cp'])[1]
# Guess source item # Guess source item
for c_item in copied_item_list: for c_item in copied_item_list:
if c_item[-1] in item.getId(): if c_item[-1] in item.getId():
source_item = '/'.join(c_item) source_item = '/'.join(c_item)
break break
else : else:
source_item = '/'.join(copied_item_list[0]) source_item = '/'.join(copied_item_list[0])
try : try:
pw.doActionFor(self_base, 'edit_action', wf_id='edit_workflow', comment='Object copied from %s' % source_item) pw.doActionFor(self_base, 'edit_action', wf_id='edit_workflow', comment='Object copied from %s' % source_item)
except WorkflowException: except WorkflowException:
pass pass
else : else:
try : pw = getToolByName(self, 'portal_workflow')
try:
pw.doActionFor(self_base, 'edit_action', wf_id='edit_workflow', comment='Object copied as %s' % item.getId()) pw.doActionFor(self_base, 'edit_action', wf_id='edit_workflow', comment='Object copied as %s' % item.getId())
except WorkflowException: except WorkflowException:
pass pass
......
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