fix: sider issues

This commit is contained in:
Saqib Ansari 2021-12-06 15:38:19 +05:30
parent 32c81818f6
commit 10b87e081c

View File

@ -7,21 +7,21 @@ def execute():
for doctype in active_sla_documents:
doctype = frappe.qb.DocType(doctype)
try:
query = (
frappe.qb
.update(doctype)
.set(doctype.agreement_status, 'First Response Due')
.where(
(doctype.first_responded_on.isnull()) | (doctype.first_responded_on == '')
)
)
query.run()
query = (
frappe.qb
.update(doctype)
.set(doctype.agreement_status, 'Resolution Due')
.where(doctype.agreement_status == 'Ongoing')
)
query.run()
except Exception as e:
frappe.qb.update(
doctype
).set(
doctype.agreement_status, 'First Response Due'
).where(
(doctype.first_responded_on.isnull()) | (doctype.first_responded_on == '')
).run()
frappe.qb.update(
doctype
).set(
doctype.agreement_status, 'Resolution Due'
).where(
doctype.agreement_status == 'Ongoing'
).run()
except Exception:
frappe.log_error('Failed to Patch SLA Status')