Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
026cf7d4
Commit
026cf7d4
authored
Feb 02, 2018
by
Tomáš Peterka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[hal_json] Improve support for rendering Forms in callDialogMethod by inspecting the meta_type
parent
aaa8d69a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
21 deletions
+31
-21
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_callDialogMethod.py
...portal_skins/erp5_hal_json_style/Base_callDialogMethod.py
+31
-21
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_callDialogMethod.py
View file @
026cf7d4
...
@@ -268,9 +268,19 @@ if True:
...
@@ -268,9 +268,19 @@ if True:
# RJS: If skin selection is different than Hal* then ERP5Document_getHateoas
# RJS: If skin selection is different than Hal* then ERP5Document_getHateoas
# does not exist and we call form method directly
# does not exist and we call form method directly
# If update_method was clicked and the target is the original dialog form then we must not call dialog_form directly because it returns HTML
if
clean_kw
.
get
(
"portal_skin"
,
context
.
getPortalObject
().
portal_skins
.
getDefaultSkin
())
not
in
(
"Hal"
,
"HalRestricted"
):
if
clean_kw
.
get
(
"portal_skin"
,
context
.
getPortalObject
().
portal_skins
.
getDefaultSkin
())
not
in
(
"Hal"
,
"HalRestricted"
):
return
dialog_form
(
**
kw
)
return
dialog_form
(
**
kw
)
# dialog_form can be anything from a pure python function, class method to ERP5 Form or Python Script
try
:
meta_type
=
dialog_form
.
meta_type
except
AttributeError
:
meta_type
=
""
if
meta_type
==
"ERP5 Form"
:
return
context
.
ERP5Document_getHateoas
(
REQUEST
=
request
,
form
=
dialog_form
,
mode
=
"form"
)
return
context
.
ERP5Document_getHateoas
(
REQUEST
=
request
,
form
=
dialog_form
,
mode
=
"form"
)
return
dialog_form
(
**
kw
)
return
getattr
(
context
,
dialog_method
)(
**
kw
)
return
getattr
(
context
,
dialog_method
)(
**
kw
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment