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.
This commit is contained in:
Ankush Menat 2023-12-15 22:00:01 +05:30 committed by GitHub
parent a9a84cc7d4
commit fa1c7b663c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -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();

View File

@ -774,10 +774,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",