mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-01 04:28:27 +00:00
Merge pull request #50120 from frappe/mergify/bp/version-15-hotfix/pr-50096
fix: added exception handling on service level agreement apply hook (backport #50096)
This commit is contained in:
@@ -484,10 +484,16 @@ def get_documents_with_active_service_level_agreement():
|
|||||||
|
|
||||||
|
|
||||||
def set_documents_with_active_service_level_agreement():
|
def set_documents_with_active_service_level_agreement():
|
||||||
active = frozenset(
|
try:
|
||||||
sla.document_type for sla in frappe.get_all("Service Level Agreement", fields=["document_type"])
|
active = frozenset(
|
||||||
)
|
sla.document_type for sla in frappe.get_all("Service Level Agreement", fields=["document_type"])
|
||||||
frappe.cache.set_value("doctypes_with_active_sla", active)
|
)
|
||||||
|
frappe.cache.set_value("doctypes_with_active_sla", active)
|
||||||
|
except (frappe.DoesNotExistError, frappe.db.TableMissingError):
|
||||||
|
# This happens during install / uninstall when wildcard hook for SLA intercepts some doc action.
|
||||||
|
# In both cases, the error can be safely ignored.
|
||||||
|
active = frozenset()
|
||||||
|
|
||||||
return active
|
return active
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user