Commit 03e24ed7 authored by Roque's avatar Roque

erp5_officejs: patch to handle custom actions for anonymous user

parent c3ffdc48
...@@ -237,6 +237,13 @@ ...@@ -237,6 +237,13 @@
form_definition = form_result.raw_dict._embedded._view._embedded.form_definition; form_definition = form_result.raw_dict._embedded._view._embedded.form_definition;
form_definition.fields_raw_properties = form_result.raw_dict._embedded._view.my_fields_raw_properties["default"]; form_definition.fields_raw_properties = form_result.raw_dict._embedded._view.my_fields_raw_properties["default"];
form_definition._actions = form_result.raw_dict._embedded._view._actions; form_definition._actions = form_result.raw_dict._embedded._view._actions;
//[PATCH] if custom action and anonymous, get _actions field from fields_raw_properties
if ("_actions" in form_definition.fields_raw_properties) {
if (!form_definition._actions && action_type === "object_jio_js_script") {
form_definition._actions = form_definition.fields_raw_properties._actions;
}
delete form_definition.fields_raw_properties._actions;
}
form_definition.group_list = form_result.raw_dict.group_list; form_definition.group_list = form_result.raw_dict.group_list;
form_definition.action_type = action_type; form_definition.action_type = action_type;
form_definition.title = action_title; form_definition.title = action_title;
......
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