Commit aa821acd authored by Jérome Perrin's avatar Jérome Perrin

a business template contains only one preference.

fix use of object builtin name.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10103 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 16a7187b
......@@ -801,7 +801,7 @@ class PreferenceTemplateItem(PathTemplateItem):
if relative_url_list != []:
LOG("PreferenceTemplateItem, _resolvePath", WARNING,
"Should be empty")
if len(id_list) is not None:
if len(id_list) != 1:
LOG("PreferenceTemplateItem, _resolvePath", WARNING,
"Should contain only one element")
# XXX hardcoded
......@@ -814,11 +814,11 @@ class PreferenceTemplateItem(PathTemplateItem):
PathTemplateItem.install(self, context, trashbin, **kw)
portal = context.getPortalObject()
for object_path in self._objects.keys():
object = portal.unrestrictedTraverse(object_path)
pref = portal.unrestrictedTraverse(object_path)
# XXX getPreferenceState is a bad name
if object.getPreferenceState() == 'disabled':
object.portal_workflow.doActionFor(
object,
if pref.getPreferenceState() == 'disabled':
portal.portal_workflow.doActionFor(
pref,
'enable_action',
wf_id='preference_workflow',
comment="Initialized during Business Template " \
......
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