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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
erp5
Commits
8a34a012
Commit
8a34a012
authored
Sep 24, 2020
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_project: make task report searchable and sortable
date and state are not supported yet
parent
5109aabb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
122 additions
and
28 deletions
+122
-28
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/ProjectLine_viewTaskReportList/listbox.xml
...s/erp5_project/ProjectLine_viewTaskReportList/listbox.xml
+37
-4
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_getSourceProjectRelatedTaskReportList.py
..._project/Project_getSourceProjectRelatedTaskReportList.py
+32
-11
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_viewTaskReportList.xml
.../portal_skins/erp5_project/Project_viewTaskReportList.xml
+2
-2
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_viewTaskReportList/listbox.xml
...skins/erp5_project/Project_viewTaskReportList/listbox.xml
+48
-8
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_viewTaskReportList/listbox_delivery_start_date.xml
...roject_viewTaskReportList/listbox_delivery_start_date.xml
+1
-1
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_viewTaskReportList/listbox_delivery_stop_date.xml
...Project_viewTaskReportList/listbox_delivery_stop_date.xml
+1
-1
bt5/erp5_project/TestTemplateItem/portal_components/test.erp5.testProject.py
...stTemplateItem/portal_components/test.erp5.testProject.py
+1
-1
No files found.
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/ProjectLine_viewTaskReportList/listbox.xml
View file @
8a34a012
...
...
@@ -126,7 +126,7 @@
<string>
Task Title
</string>
</tuple>
<tuple>
<string>
getTranslatedPortalT
ype
</string>
<string>
translated_portal_t
ype
</string>
<string>
Type
</string>
</tuple>
<tuple>
...
...
@@ -198,8 +198,12 @@
<value>
<list>
<tuple>
<string>
Task
</string>
<string>
Task
</string>
<string>
Task Line
</string>
<string>
Task Line
</string>
</tuple>
<tuple>
<string>
Task Report Line
</string>
<string>
Task Report Line
</string>
</tuple>
</list>
</value>
...
...
@@ -230,7 +234,36 @@
<item>
<key>
<string>
sort_columns
</string>
</key>
<value>
<list/>
<list>
<tuple>
<string>
reference
</string>
<string>
Reference
</string>
</tuple>
<tuple>
<string>
parent_title
</string>
<string>
Task Title
</string>
</tuple>
<tuple>
<string>
translated_portal_type
</string>
<string>
Type
</string>
</tuple>
<tuple>
<string>
title
</string>
<string>
Task Line Title
</string>
</tuple>
<tuple>
<string>
source_title
</string>
<string>
Assignee
</string>
</tuple>
<tuple>
<string>
resource_title
</string>
<string>
Resource
</string>
</tuple>
<tuple>
<string>
destination_title
</string>
<string>
Location
</string>
</tuple>
</list>
</value>
</item>
<item>
...
...
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_getSourceProjectRelatedTaskReportList.py
View file @
8a34a012
...
...
@@ -2,12 +2,14 @@ source_project_uid_list = [x.uid for x in context.portal_catalog(
relative_url
=
'%s/%%'
%
context
.
getRelativeUrl
())]
+
[
context
.
getUid
()]
from
Products.ZSQLCatalog.SQLCatalog
import
Query
from
Products.ZSQLCatalog.SQLCatalog
import
ComplexQuery
from
Products.ZSQLCatalog.SQLCatalog
import
SimpleQuery
sql_kw
=
{}
if
kw
.
has_key
(
'from_date'
)
and
kw
[
'from_date'
]
is
not
None
:
query_kw
=
{
'delivery.start_date'
:
kw
[
'from_date'
],
'range'
:
'min'
}
sql_kw
[
'delivery.start_date'
]
=
Query
(
**
query_kw
)
if
kw
.
has_key
(
'at_date'
)
and
kw
[
'at_date'
]
is
not
None
:
query_kw
=
{
'delivery.stop_date'
:
kw
[
'at_date'
],
'range'
:
'ngt'
}
...
...
@@ -22,7 +24,6 @@ else:
task_simulation_state
=
context
.
getPortalDraftOrderStateList
()
+
\
context
.
getPortalPlannedOrderStateList
()
task_report_simulation_state
=
""
task_list
=
[
x
.
getObject
()
for
x
in
\
context
.
portal_catalog
(
selection_report
=
selection_report
,
portal_type
=
'Task'
,
...
...
@@ -35,17 +36,37 @@ task_list.extend([x.getObject() for x in \
source_project_uid
=
source_project_uid_list
,
simulation_state
=
task_report_simulation_state
,
**
sql_kw
)])
task_line_list
=
[]
for
task
in
task_list
:
task_line_list
.
extend
(
task
.
objectValues
(
portal_type
=
(
'Task Line'
,
'Task Report Line'
)))
key_value
=
kw
.
pop
(
'source_title'
,
None
)
if
key_value
:
kw
[
'source_title_query'
]
=
ComplexQuery
(
SimpleQuery
(
source_title
=
key_value
),
SimpleQuery
(
parent_source_title
=
key_value
),
logical_operator
=
'OR'
)
key_value
=
kw
.
pop
(
'destination_title'
,
None
)
if
key_value
:
kw
[
'destination_title_query'
]
=
ComplexQuery
(
SimpleQuery
(
destination_title
=
key_value
),
SimpleQuery
(
parent_destination_title
=
key_value
),
logical_operator
=
'OR'
)
key_value
=
kw
.
pop
(
'resource_title'
,
None
)
if
key_value
:
kw
[
'resource_title_query'
]
=
ComplexQuery
(
SimpleQuery
(
resource_title
=
key_value
),
SimpleQuery
(
parent_resource_title
=
key_value
),
logical_operator
=
'OR'
)
task_line_list
=
context
.
portal_catalog
(
parent_uid
=
[
x
.
uid
for
x
in
task_list
],
**
kw
)
def
sortTaskLine
(
a
,
b
):
result
=
cmp
(
a
.
getStartDate
(),
b
.
getStartDate
())
if
result
==
0
:
result
=
cmp
(
a
.
getTitle
(),
b
.
getTitle
())
return
result
if
getattr
(
kw
,
'sort_on'
,
None
):
def
sortTaskLine
(
a
,
b
):
result
=
cmp
(
a
.
getStartDate
(),
b
.
getStartDate
())
if
result
==
0
:
result
=
cmp
(
a
.
getTitle
(),
b
.
getTitle
())
return
result
task_line_list
.
sort
(
sortTaskLine
)
task_line_list
.
sort
(
sortTaskLine
)
return
task_line_list
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_viewTaskReportList.xml
View file @
8a34a012
...
...
@@ -81,8 +81,8 @@
<key>
<string>
hidden
</string>
</key>
<value>
<list>
<string>
listbox_start_date
</string>
<string>
listbox_stop_date
</string>
<string>
listbox_
delivery_
start_date
</string>
<string>
listbox_
delivery_
stop_date
</string>
</list>
</value>
</item>
...
...
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_viewTaskReportList/listbox.xml
View file @
8a34a012
...
...
@@ -18,6 +18,7 @@
<string>
report_root_list
</string>
<string>
report_tree
</string>
<string>
selection_name
</string>
<string>
sort
</string>
<string>
sort_columns
</string>
<string>
title
</string>
</list>
...
...
@@ -126,7 +127,7 @@
<string>
Task Title
</string>
</tuple>
<tuple>
<string>
getTranslatedPortalT
ype
</string>
<string>
translated_portal_t
ype
</string>
<string>
Type
</string>
</tuple>
<tuple>
...
...
@@ -142,11 +143,11 @@
<string>
Resource
</string>
</tuple>
<tuple>
<string>
start_date
</string>
<string>
delivery.
start_date
</string>
<string>
Begin Date
</string>
</tuple>
<tuple>
<string>
stop_date
</string>
<string>
delivery.
stop_date
</string>
<string>
End Date
</string>
</tuple>
<tuple>
...
...
@@ -169,11 +170,11 @@
<value>
<list>
<tuple>
<string>
start_date
</string>
<string>
delivery.
start_date
</string>
<string>
Begin Date
</string>
</tuple>
<tuple>
<string>
stop_date
</string>
<string>
delivery.
stop_date
</string>
<string>
End Date
</string>
</tuple>
</list>
...
...
@@ -198,8 +199,12 @@
<value>
<list>
<tuple>
<string>
Task
</string>
<string>
Task
</string>
<string>
Task Line
</string>
<string>
Task Line
</string>
</tuple>
<tuple>
<string>
Task Report Line
</string>
<string>
Task Report Line
</string>
</tuple>
</list>
</value>
...
...
@@ -228,11 +233,46 @@
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
sort
_columns
</string>
</key>
<key>
<string>
sort
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
sort_columns
</string>
</key>
<value>
<list>
<tuple>
<string>
reference
</string>
<string>
Reference
</string>
</tuple>
<tuple>
<string>
parent_title
</string>
<string>
Task Title
</string>
</tuple>
<tuple>
<string>
translated_portal_type
</string>
<string>
Type
</string>
</tuple>
<tuple>
<string>
title
</string>
<string>
Task Line Title
</string>
</tuple>
<tuple>
<string>
source_title
</string>
<string>
Assignee
</string>
</tuple>
<tuple>
<string>
resource_title
</string>
<string>
Resource
</string>
</tuple>
<tuple>
<string>
destination_title
</string>
<string>
Location
</string>
</tuple>
</list>
</value>
</item>
<item>
<key>
<string>
target
</string>
</key>
<value>
<string>
Click to edit the target
</string>
</value>
...
...
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_viewTaskReportList/listbox_start_date.xml
→
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_viewTaskReportList/listbox_
delivery_
start_date.xml
View file @
8a34a012
...
...
@@ -16,7 +16,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox_start_date
</string>
</value>
<value>
<string>
listbox_
delivery_
start_date
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
...
...
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_viewTaskReportList/listbox_stop_date.xml
→
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project/Project_viewTaskReportList/listbox_
delivery_
stop_date.xml
View file @
8a34a012
...
...
@@ -16,7 +16,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
listbox_stop_date
</string>
</value>
<value>
<string>
listbox_
delivery_
stop_date
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
...
...
bt5/erp5_project/TestTemplateItem/portal_components/test.erp5.testProject.py
View file @
8a34a012
...
...
@@ -144,7 +144,7 @@ class TestProject(ERP5TypeTestCase):
# It shows planned tasks also.
task_line_list
=
project
.
Project_getSourceProjectRelatedTaskReportList
()
self
.
assertEqual
(
1
,
len
(
task_line_list
))
self
.
assertEqual
(
task_line_list
[
0
],
task
.
default_task_line
)
self
.
assertEqual
(
task_line_list
[
0
]
.
getObject
()
,
task
.
default_task_line
)
task
.
confirm
()
self
.
tic
()
...
...
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