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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
87c8e155
Commit
87c8e155
authored
Apr 21, 2016
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SimulationTool: Include related_group_by in select_dict.
Also, simplify code a bit while reading it.
parent
56e5b96f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
6 deletions
+3
-6
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+3
-6
No files found.
product/ERP5/Tool/SimulationTool.py
View file @
87c8e155
...
@@ -782,10 +782,10 @@ class SimulationTool(BaseTool):
...
@@ -782,10 +782,10 @@ class SimulationTool(BaseTool):
new_kw
[
'related_key_dict'
]
=
related_key_dict
.
copy
()
new_kw
[
'related_key_dict'
]
=
related_key_dict
.
copy
()
new_kw
[
'related_key_dict_passthrough'
]
=
kw
new_kw
[
'related_key_dict_passthrough'
]
=
kw
# Check we do not get a known group_by
# Check we do not get a known group_by
related_group_by
=
[]
if
group_by
:
if
group_by
:
if
isinstance
(
group_by
,
basestring
):
if
isinstance
(
group_by
,
basestring
):
group_by
=
(
group_by
,)
group_by
=
(
group_by
,)
related_group_by
=
[]
for
value
in
group_by
:
for
value
in
group_by
:
if
value
==
"node_uid"
:
if
value
==
"node_uid"
:
group_by_node
=
1
group_by_node
=
1
...
@@ -817,7 +817,7 @@ class SimulationTool(BaseTool):
...
@@ -817,7 +817,7 @@ class SimulationTool(BaseTool):
group_by_date
=
1
group_by_date
=
1
else
:
else
:
related_group_by
.
append
(
value
)
related_group_by
.
append
(
value
)
if
len
(
related_group_by
)
:
if
related_group_by
:
new_kw
[
'related_key_dict_passthrough'
][
'group_by_list'
]
=
related_group_by
new_kw
[
'related_key_dict_passthrough'
][
'group_by_list'
]
=
related_group_by
#variation_category_uid_list = self._generatePropertyUidList(variation_category)
#variation_category_uid_list = self._generatePropertyUidList(variation_category)
...
@@ -879,10 +879,7 @@ class SimulationTool(BaseTool):
...
@@ -879,10 +879,7 @@ class SimulationTool(BaseTool):
# the caller can also pass select_dict or select_list. select_expression,
# the caller can also pass select_dict or select_list. select_expression,
# which is deprecated in ZSQLCatalog is not supported here.
# which is deprecated in ZSQLCatalog is not supported here.
select_dict
=
kw
.
get
(
'select_dict'
,
{})
select_dict
=
kw
.
get
(
'select_dict'
,
{})
# we support select_list, if passed
select_dict
.
update
(
dict
.
fromkeys
(
list
(
kw
.
get
(
'select_list'
,
[]))
+
related_group_by
))
select_list
=
kw
.
get
(
'select_list'
,
[])
for
select_key
in
kw
.
get
(
'select_list'
,
[]):
select_dict
[
select_key
]
=
None
new_kw
[
'select_dict'
]
=
select_dict
new_kw
[
'select_dict'
]
=
select_dict
related_key_select_expression_list
=
[]
related_key_select_expression_list
=
[]
...
...
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