fix(patch): update sla doctype directly (#32014)

fix: update sla doctype directly
This commit is contained in:
Ankush Menat 2022-08-29 20:50:27 +05:30 committed by GitHub
parent 25072e5d32
commit 2d41704424
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,8 @@ def execute():
for sla in frappe.get_all("Service Level Agreement"): for sla in frappe.get_all("Service Level Agreement"):
agreement = frappe.get_doc("Service Level Agreement", sla.name) agreement = frappe.get_doc("Service Level Agreement", sla.name)
agreement.document_type = "Issue" agreement.db_set("document_type", "Issue")
agreement.reload()
agreement.apply_sla_for_resolution = 1 agreement.apply_sla_for_resolution = 1
agreement.append("sla_fulfilled_on", {"status": "Resolved"}) agreement.append("sla_fulfilled_on", {"status": "Resolved"})
agreement.append("sla_fulfilled_on", {"status": "Closed"}) agreement.append("sla_fulfilled_on", {"status": "Closed"})