Commit 5080e33c authored by Romain Courteaud's avatar Romain Courteaud

erp5_hal_json_style: put the web site in the acquisition context + keep_items

parent 4a36016f
......@@ -60,10 +60,17 @@ result_dict = {
}
}
# Put the web site in the acquisition context
# this occurs when doing a .getObject from the catalog for example
if (not context.isWebMode()) and (context.REQUEST.get('web_section_value', None) is not None):
portal = context.getPortalObject()
web_section = portal.restrictedTraverse("/".join(context.REQUEST['web_section_value']))
context = web_section.restrictedTraverse(context.getRelativeUrl())
# form_id = 'view' means use default document view. Let the JS handle it
# In case of dialog submit, if redirecting to the original form, let the JS handle the navigation history
if (form_id is not None) and \
(form_id not in ['view', 'Base_viewFakePythonScriptActionForm']) and \
if (form_id not in [None, 'Base_viewFakePythonScriptActionForm', 'Base_viewFakeJumpForm']) and \
((form_id != 'view') or (keep_items)) and \
(form_id != previous_form_id) and \
(not form_id.startswith('http')) and \
(context.isWebMode()):
......
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