Browse Source

fix: yet another fix for flaky SLA Test

develop
Rucha Mahabal 3 years ago
parent
commit
091f41e986
  1. 5
      erpnext/support/doctype/service_level_agreement/service_level_agreement.json
  2. 13
      erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py

5
erpnext/support/doctype/service_level_agreement/service_level_agreement.json

@ -150,7 +150,8 @@
"fieldtype": "Link", "fieldtype": "Link",
"label": "Document Type", "label": "Document Type",
"options": "DocType", "options": "DocType",
"reqd": 1 "reqd": 1,
"set_only_once": 1
}, },
{ {
"default": "1", "default": "1",
@ -178,7 +179,7 @@
} }
], ],
"links": [], "links": [],
"modified": "2021-05-29 13:35:41.956849", "modified": "2021-07-08 12:28:46.283334",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Support", "module": "Support",
"name": "Service Level Agreement", "name": "Service Level Agreement",

13
erpnext/support/doctype/service_level_agreement/test_service_level_agreement.py

@ -328,16 +328,11 @@ def create_service_level_agreement(default_service_level_agreement, holiday_list
"entity": entity "entity": entity
}) })
service_level_agreement_exists = frappe.db.exists("Service Level Agreement", filters) sla = frappe.db.exists("Service Level Agreement", filters)
if sla:
frappe.delete_doc("Service Level Agreement", sla, force=1)
if not service_level_agreement_exists: return frappe.get_doc(service_level_agreement).insert(ignore_permissions=True)
doc = frappe.get_doc(service_level_agreement).insert(ignore_permissions=True)
else:
doc = frappe.get_doc("Service Level Agreement", service_level_agreement_exists)
doc.update(service_level_agreement)
doc.save()
return doc
def create_customer(): def create_customer():

Loading…
Cancel
Save