File tree Expand file tree Collapse file tree
erpnext/support/doctype/service_level_agreement Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -449,10 +449,16 @@ def get_documents_with_active_service_level_agreement():
449449
450450
451451def set_documents_with_active_service_level_agreement ():
452- active = [
453- sla .document_type for sla in frappe .get_all ("Service Level Agreement" , fields = ["document_type" ])
454- ]
455- frappe .cache ().hset ("service_level_agreement" , "active" , active )
452+ try :
453+ active = frozenset (
454+ sla .document_type for sla in frappe .get_all ("Service Level Agreement" , fields = ["document_type" ])
455+ )
456+ frappe .cache ().hset ("service_level_agreement" , "active" , active )
457+ except (frappe .DoesNotExistError , frappe .db .TableMissingError ):
458+ # This happens during install / uninstall when wildcard hook for SLA intercepts some doc action.
459+ # In both cases, the error can be safely ignored.
460+ active = frozenset ()
461+
456462 return active
457463
458464
You can’t perform that action at this time.
0 commit comments