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
Iliya Manolov
erp5
Commits
72b60755
Commit
72b60755
authored
Dec 28, 2016
by
Jérome Perrin
Committed by
Gabriel Monnerat
Jan 03, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inventory_api: rely on catalog to add slot_index in the query
instead of implementing this logic in ZSQL's DTML
parent
71ec5a73
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
product/ERP5/Tool/SimulationTool.py
product/ERP5/Tool/SimulationTool.py
+8
-0
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetInventoryList.sql
...tem/portal_skins/erp5_core/Resource_zGetInventoryList.sql
+0
-6
No files found.
product/ERP5/Tool/SimulationTool.py
View file @
72b60755
...
...
@@ -511,6 +511,14 @@ class SimulationTool(BaseTool):
# catalog
new_kw
.
pop
(
'ignore_group_by'
,
None
)
# When group_by_time_sequence_list is used, the ZSQL method template
# will use a variable slot_index, we want to select it, group and order
# by it.
if
sql_kw
.
get
(
'group_by_time_sequence_list'
):
new_kw
[
'group_by_list'
]
=
new_kw
.
get
(
'group_by_list'
,
[])
+
[
'slot_index'
]
new_kw
[
'order_by_list'
]
=
new_kw
.
get
(
'order_by_list'
,
[])
+
[(
'slot_index'
,
)]
new_kw
.
setdefault
(
'select_dict'
,
{})[
'slot_index'
]
=
'slot_index'
sql_kw
.
update
(
ctool
.
buildSQLQuery
(
**
new_kw
))
return
sql_kw
...
...
product/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Resource_zGetInventoryList.sql
View file @
72b60755
...
...
@@ -77,7 +77,6 @@ SELECT
COUNT
(
DISTINCT
<
dtml
-
var
stock_table_id
>
.
uid
)
AS
stock_uid
,
MAX
(
<
dtml
-
var
stock_table_id
>
.
date
)
AS
date
</
dtml
-
if
>
<
dtml
-
if
group_by_time_sequence_list
>
,
slot_index
</
dtml
-
if
>
<
dtml
-
comment
>
XXX
is
this
really
needed
?
are
empty
slots
returned
?
</
dtml
-
comment
>
<
dtml
-
if
select_expression
>
,
<
dtml
-
var
select_expression
></
dtml
-
if
>
...
...
@@ -188,16 +187,11 @@ WHERE
<
dtml
-
if
group_by_expression
>
GROUP
BY
<
dtml
-
if
transformed_uid
>
transformation
.
transformed_uid
,
</
dtml
-
if
>
<
dtml
-
if
group_by_time_sequence_list
>
slot_index
,
</
dtml
-
if
>
<
dtml
-
var
group_by_expression
>
</
dtml
-
if
>
<
dtml
-
if
order_by_expression
>
ORDER
BY
<
dtml
-
var
order_by_expression
>
<
dtml
-
else
>
<
dtml
-
if
group_by_time_sequence_list
>
ORDER
BY
slot_index
</
dtml
-
if
>
</
dtml
-
if
>
</
dtml
-
let
>
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