refactor: desk missing doc handling
- reduce 1 query - make normal and virtual doc behave in same manner
This commit is contained in:
parent
0285d4f686
commit
d11fdc3ca4
1 changed files with 3 additions and 2 deletions
|
|
@ -31,10 +31,11 @@ def getdoc(doctype, name, user=None):
|
|||
if not name:
|
||||
name = doctype
|
||||
|
||||
if not is_virtual_doctype(doctype) and not frappe.db.exists(doctype, name):
|
||||
try:
|
||||
doc = frappe.get_doc(doctype, name)
|
||||
except frappe.DoesNotExistError:
|
||||
return []
|
||||
|
||||
doc = frappe.get_doc(doctype, name)
|
||||
run_onload(doc)
|
||||
|
||||
if not doc.has_permission("read"):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue