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
Alexander Emmerich
erp5
Commits
8370151d
Commit
8370151d
authored
Jan 12, 2021
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! erp5_core: unify Predicate_edit code into Base_edit.
parent
77037609
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
10 deletions
+4
-10
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_edit.py
...emplateItem/portal_skins/erp5_hal_json_style/Base_edit.py
+2
-5
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.py
...core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.py
+2
-5
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_edit.py
View file @
8370151d
...
...
@@ -62,10 +62,7 @@ def editListBox(listbox_field, listbox):
if
listbox
is
None
:
return
if
context
.
isPredicate
():
predicate_listbox
=
set
(
context
.
getCriterionPropertyList
())
==
set
(
listbox
.
keys
())
else
:
predicate_listbox
=
False
# extract hidden (global) attributes from request to be used in listbox's update
is_predicate_listbox
=
set
(
getattr
(
context
,
'getCriterionPropertyList'
,
lambda
:
[])())
==
set
(
listbox
.
keys
())
# extract hidden (global) attributes from request to be used in listbox's update
global_attr
=
{
hidden_key
:
getattr
(
request
,
hidden_key
,
None
)
...
...
@@ -74,7 +71,7 @@ def editListBox(listbox_field, listbox):
else
{}
for
item_url
,
item_value
in
listbox
.
items
():
if
predicate_listbox
:
if
is_
predicate_listbox
:
item_value
.
update
(
global_attr
)
context
.
setCriterion
(
item_url
,
**
item_value
)
continue
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.py
View file @
8370151d
...
...
@@ -56,16 +56,13 @@ def editListBox(listbox_field, listbox):
"""
if
listbox
is
not
None
:
global_property_dict
=
{}
if
context
.
isPredicate
():
predicate_listbox
=
set
(
context
.
getCriterionPropertyList
())
==
set
(
listbox
.
keys
())
else
:
predicate_listbox
=
False
is_predicate_listbox
=
set
(
getattr
(
context
,
'getCriterionPropertyList'
,
lambda
:
[])())
==
set
(
listbox
.
keys
())
if
listbox_field
.
has_value
(
'global_attributes'
):
hidden_attribute_list
=
[
x
[
0
]
for
x
in
listbox_field
.
get_value
(
'global_attributes'
)]
for
hidden_attribute
in
hidden_attribute_list
:
global_property_dict
[
hidden_attribute
]
=
getattr
(
request
,
hidden_attribute
,
None
)
for
item_url
,
listbox_item_dict
in
listbox
.
items
():
if
predicate_listbox
:
if
is_
predicate_listbox
:
listbox_item_dict
.
update
(
global_property_dict
)
context
.
setCriterion
(
item_url
,
**
listbox_item_dict
)
continue
...
...
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