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
Hamza
erp5
Commits
4f30f0e8
Commit
4f30f0e8
authored
Jan 25, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
officejs_support_request_ui: workaround when we don't have a SR in each state
parent
c3304c6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py
...quest/SupportRequest_getSupportRequestStatisticsAsJson.py
+10
-0
No files found.
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py
View file @
4f30f0e8
...
...
@@ -16,6 +16,7 @@ date_30_midnight = DateTime(now_date - timedelta(days=30)).earliestTime()
# currently active support requests by state. Unless CRM agents are late
# in the processing of these support requests, they should not be too many.
count_by_state_and_date_range
=
defaultdict
(
lambda
:
defaultdict
(
int
))
for
brain
in
portal
.
portal_catalog
(
portal_type
=
"Support Request"
,
simulation_state
=
(
"submitted"
,
"suspended"
,
"validated"
,),
...
...
@@ -49,6 +50,14 @@ count_by_state_and_date_range = {
for
date_range
in
date_range_list
]
}
for
state
in
count_by_state_and_date_range
}
# XXX
state_title_by_state_id
=
portal
.
ERP5Site_getTicketWorkflowStateInfoDict
()
for
c
in
state_title_by_state_id
.
keys
():
if
c
not
in
count_by_state_and_date_range
:
count_by_state_and_date_range
[
c
]
=
{
"date_range_list"
:
date_range_list
,
"count_list"
:
[
0
,
0
,
0
,
0
],
}
# Count last month activity by state
# we only select support requests from last 30 days, so there should not be too many.
...
...
@@ -66,3 +75,4 @@ return dumps({
"count_by_state_and_date_range"
:
count_by_state_and_date_range
,
"state_title_by_state_id"
:
portal
.
ERP5Site_getTicketWorkflowStateInfoDict
()
})
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