Commit 1d685807 authored by Nicolas Dumazet's avatar Nicolas Dumazet

create Active Process using newContent to make sure that the active process

has accessors. If we dont do this, the object has no accessors and is useless
as a context.

Note that the previous generateNewId() call was exactly as harmful as this code,
as generateNewId() needs properties and accessors from ERP5, and can't be
reasonably be decoupled from ERP5


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42919 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a18985aa
......@@ -1424,10 +1424,13 @@ class ActivityTool (Folder, UniqueObject):
return message_count
security.declareProtected( CMFCorePermissions.ManagePortal , 'newActiveProcess' )
def newActiveProcess(self, **kw):
from ActiveProcess import addActiveProcess
new_id = str(self.generateNewId())
return addActiveProcess(self, new_id, **kw)
def newActiveProcess(self, REQUEST=None, **kw):
# note: if one wants to create an Actice Process without ERP5 products,
# she can call ActiveProcess.addActiveProcess
obj = self.newContent(portal_type="Active Process", **kw)
if REQUEST is not None:
REQUEST['RESPONSE'].redirect( 'manage_main' )
return obj
# Active synchronisation methods
security.declarePrivate('validateOrder')
......
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