Merge pull request #25828 from Anuja-pawar/issue-summary-report-fix

fix: Add Hold status column in the Issue Summary Report
This commit is contained in:
Deepesh Garg 2021-05-29 19:24:15 +05:30 committed by GitHub
commit d067e25dad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 39 additions and 3 deletions

View File

@ -781,3 +781,4 @@ erpnext.patches.v13_0.germany_fill_debtor_creditor_number
erpnext.patches.v13_0.set_pos_closing_as_failed erpnext.patches.v13_0.set_pos_closing_as_failed
erpnext.patches.v13_0.update_timesheet_changes erpnext.patches.v13_0.update_timesheet_changes
erpnext.patches.v13_0.set_training_event_attendance erpnext.patches.v13_0.set_training_event_attendance
erpnext.patches.v13_0.rename_issue_status_hold_to_on_hold

View File

@ -0,0 +1,20 @@
# Copyright (c) 2020, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if frappe.db.exists('DocType', 'Issue'):
frappe.reload_doc("support", "doctype", "issue")
rename_status()
def rename_status():
frappe.db.sql("""
UPDATE
`tabIssue`
SET
status = 'On Hold'
WHERE
status = 'Hold'
""")

View File

@ -119,7 +119,7 @@
"no_copy": 1, "no_copy": 1,
"oldfieldname": "status", "oldfieldname": "status",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "Open\nReplied\nHold\nResolved\nClosed", "options": "Open\nReplied\nOn Hold\nResolved\nClosed",
"search_index": 1 "search_index": 1
}, },
{ {
@ -410,7 +410,7 @@
"icon": "fa fa-ticket", "icon": "fa fa-ticket",
"idx": 7, "idx": 7,
"links": [], "links": [],
"modified": "2020-08-11 18:49:07.574769", "modified": "2021-05-26 10:49:07.574769",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Support", "module": "Support",
"name": "Issue", "name": "Issue",

View File

@ -42,6 +42,7 @@ frappe.query_reports["Issue Summary"] = {
"", "",
{label: __('Open'), value: 'Open'}, {label: __('Open'), value: 'Open'},
{label: __('Replied'), value: 'Replied'}, {label: __('Replied'), value: 'Replied'},
{label: __('On Hold'), value: 'On Hold'},
{label: __('Resolved'), value: 'Resolved'}, {label: __('Resolved'), value: 'Resolved'},
{label: __('Closed'), value: 'Closed'} {label: __('Closed'), value: 'Closed'}
] ]

View File

@ -62,7 +62,7 @@ class IssueSummary(object):
'width': 200 'width': 200
}) })
self.statuses = ['Open', 'Replied', 'Resolved', 'Closed'] self.statuses = ['Open', 'Replied', 'On Hold', 'Resolved', 'Closed']
for status in self.statuses: for status in self.statuses:
self.columns.append({ self.columns.append({
'label': _(status), 'label': _(status),
@ -265,6 +265,7 @@ class IssueSummary(object):
labels = [] labels = []
open_issues = [] open_issues = []
replied_issues = [] replied_issues = []
on_hold_issues = []
resolved_issues = [] resolved_issues = []
closed_issues = [] closed_issues = []
@ -277,6 +278,7 @@ class IssueSummary(object):
labels.append(entry.get(entity_field)) labels.append(entry.get(entity_field))
open_issues.append(entry.get('open')) open_issues.append(entry.get('open'))
replied_issues.append(entry.get('replied')) replied_issues.append(entry.get('replied'))
on_hold_issues.append(entry.get('on_hold'))
resolved_issues.append(entry.get('resolved')) resolved_issues.append(entry.get('resolved'))
closed_issues.append(entry.get('closed')) closed_issues.append(entry.get('closed'))
@ -292,6 +294,10 @@ class IssueSummary(object):
'name': 'Replied', 'name': 'Replied',
'values': replied_issues[:30] 'values': replied_issues[:30]
}, },
{
'name': 'On Hold',
'values': on_hold_issues[:30]
},
{ {
'name': 'Resolved', 'name': 'Resolved',
'values': resolved_issues[:30] 'values': resolved_issues[:30]
@ -313,12 +319,14 @@ class IssueSummary(object):
open_issues = 0 open_issues = 0
replied = 0 replied = 0
on_hold = 0
resolved = 0 resolved = 0
closed = 0 closed = 0
for entry in self.data: for entry in self.data:
open_issues += entry.get('open') open_issues += entry.get('open')
replied += entry.get('replied') replied += entry.get('replied')
on_hold += entry.get('on_hold')
resolved += entry.get('resolved') resolved += entry.get('resolved')
closed += entry.get('closed') closed += entry.get('closed')
@ -335,6 +343,12 @@ class IssueSummary(object):
'label': _('Replied'), 'label': _('Replied'),
'datatype': 'Int', 'datatype': 'Int',
}, },
{
'value': on_hold,
'indicator': 'Grey',
'label': _('On Hold'),
'datatype': 'Int',
},
{ {
'value': resolved, 'value': resolved,
'indicator': 'Green', 'indicator': 'Green',