Skip to content

Commit

Permalink
fix: Reset SLA on issue doesn't work (backport #38789) (#38790)
Browse files Browse the repository at this point in the history
fix: Reset SLA on issue doesn't work (#38789)

This was broken since last refactor where it was spun off to work with
all types of doctypes but client side code was never adapted.

(cherry picked from commit fa1c7b6)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush authored Dec 15, 2023
1 parent 34549b6 commit 942f34a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion erpnext/support/doctype/issue/issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ frappe.ui.form.on("Issue", {

frappe.call("erpnext.support.doctype.service_level_agreement.service_level_agreement.reset_service_level_agreement", {
reason: values.reason,
user: frappe.session.user_email
user: frappe.session.user_email,
doctype: frm.doc.doctype,
docname: frm.doc.name,
}, () => {
reset_sla.enable_primary_action();
frm.refresh();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,10 +739,12 @@ def get_response_and_resolution_duration(doc):
return priority


def reset_service_level_agreement(doc, reason, user):
@frappe.whitelist()
def reset_service_level_agreement(doctype: str, docname: str, reason, user):
if not frappe.db.get_single_value("Support Settings", "allow_resetting_service_level_agreement"):
frappe.throw(_("Allow Resetting Service Level Agreement from Support Settings."))

doc = frappe.get_doc(doctype, docname)
frappe.get_doc(
{
"doctype": "Comment",
Expand Down

0 comments on commit 942f34a

Please sign in to comment.