[minor] catch illegal reference, via error report
This commit is contained in:
parent
87b0bec2cf
commit
afacc3d779
@ -89,6 +89,9 @@ class TransactionBase(StatusUpdater):
|
||||
prevdoc_values = frappe.db.get_value(reference_doctype, reference_name,
|
||||
[d[0] for d in fields], as_dict=1)
|
||||
|
||||
if not prevdoc_values:
|
||||
frappe.throw(_("Invalid reference {0} {1}").format(reference_doctype, reference_name))
|
||||
|
||||
for field, condition in fields:
|
||||
if prevdoc_values[field] is not None:
|
||||
self.validate_value(field, condition, prevdoc_values[field], doc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user