Commit 59fe5071 authored by Gabriel Monnerat's avatar Gabriel Monnerat

erp5_xhtml_style: add compatibility with _raw for every category

parent 9e3b20c9
...@@ -3,21 +3,24 @@ actions that does not provide one. ...@@ -3,21 +3,24 @@ actions that does not provide one.
""" """
from Products.PythonScripts.standard import url_quote from Products.PythonScripts.standard import url_quote
if dialog_category == 'object_jump': action_mapping_dict = {
return sorted(actions.get('object_jump', []) + actions.get('object_jio_jump', []), key=lambda x: x["priority"]) "object_jump": ["object_jump", "object_jio_jump"],
if dialog_category == 'object_report': "object_report": ["object_report", "object_jio_report"],
return sorted(actions.get('object_report', []) + actions.get('object_jio_report', []), key=lambda x: x["priority"]) "object_exchange": ["object_exchange", "object_jio_exchange"],
elif dialog_category == 'object_exchange': "object_action": ["object_action", "object_jio_action"],
return sorted(actions.get('object_exchange', []) + actions.get('object_jio_exchange', []), key=lambda x: x["priority"]) "object_fast_input": ["object_fast_input", "object_jio_fast_input"],
elif dialog_category == 'object_action': "object_button": ["object_button", "object_jio_button"]
return sorted(actions.get('object_action', []) + actions.get('object_jio_action', []), key=lambda x: x["priority"]) }
elif dialog_category == 'object_fast_input':
return sorted(actions.get('object_fast_input', []) + actions.get('object_jio_fast_input', []), key=lambda x: x["priority"]) def getActionList(dialog_category):
elif dialog_category == 'object_button': action_list = []
return sorted(actions.get('object_button', []) + for key in action_mapping_dict[dialog_category]:
actions.get('object_jio_button', []) + action_list += actions.get(key, []) + actions.get("{}_raw".format(key), [])
actions.get('object_jio_button_raw', []), return sorted(action_list, key=lambda x: x["priority"])
key=lambda x: x["priority"])
if dialog_category in action_mapping_dict:
return getActionList(dialog_category)
if dialog_category != 'object_print': if dialog_category != 'object_print':
return actions.get(dialog_category, []) return actions.get(dialog_category, [])
......
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