Commit 6e8435c6 authored by Aurel's avatar Aurel

sort action based on prioriy at install


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4852 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c41dd218
......@@ -1387,7 +1387,18 @@ class ActionTemplateItem(ObjectTemplateItem):
, visible = action.visible
, icon = getattr(action, 'icon', None) and action.icon.text or ''
, optional = getattr(action, 'optional', 0)
, priority = action.priority
)
# sort action now
# XXX suppose that priority are properly on actions
new_priority = action.priority
action_list = obj.listActions()
move_down_list = []
for index in range(len(action_list)):
action = action_list[index]
if action.priority > new_priority:
move_down_list.append(str(index))
obj.moveDownActions(selections=tuple(move_down_list))
else:
BaseTemplateItem.install(self, context, trashbin, **kw)
p = context.getPortalObject()
......
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