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
Labels
Merge Requests
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
c0aafd6b
Commit
c0aafd6b
authored
Mar 05, 2019
by
Romain Courteaud
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_officejs_support_request_ui] Init the dictionnaries values
Prevent "cannot read property of undefined" errors on the JS side.
parent
2bbd7b5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py
...quest/SupportRequest_getSupportRequestStatisticsAsJson.py
+12
-0
No files found.
bt5/erp5_officejs_support_request_ui/SkinTemplateItem/portal_skins/erp5_officejs_support_request/SupportRequest_getSupportRequestStatisticsAsJson.py
View file @
c0aafd6b
...
...
@@ -16,6 +16,10 @@ 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
))
# Set default entried, as the JS tries to access them
for
hardcoded_js_state
in
[
'validated'
,
'submitted'
,
'suspended'
,
'invalidated'
,
'YYY'
]:
count_by_state_and_date_range
[
hardcoded_js_state
][
"XXX"
]
=
0
for
brain
in
portal
.
portal_catalog
(
portal_type
=
"Support Request"
,
simulation_state
=
(
"submitted"
,
"suspended"
,
"validated"
,),
...
...
@@ -49,6 +53,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.
...
...
Jérome Perrin
@jerome
mentioned in merge request
!827
·
Mar 08, 2019
mentioned in merge request
!827
mentioned in merge request !827
Toggle commit 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