Commit c3c0578e authored by Aurel's avatar Aurel

sort action's priority also for old format


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4853 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6e8435c6
......@@ -1389,7 +1389,7 @@ class ActionTemplateItem(ObjectTemplateItem):
, optional = getattr(action, 'optional', 0)
, priority = action.priority
)
# sort action now
# sort action based on the priority define on it
# XXX suppose that priority are properly on actions
new_priority = action.priority
action_list = obj.listActions()
......@@ -1420,6 +1420,15 @@ class ActionTemplateItem(ObjectTemplateItem):
, icon = getattr(action, 'icon', None) and action.icon.text or ''
, optional = getattr(action, 'optional', 0)
)
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))
def uninstall(self, context, **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