fix(Addresses and Contacts Report): Frappe throw when doctype has no records (#7503)

This commit is contained in:
Himanshu 2019-05-21 14:51:09 +05:30 committed by Faris Ansari
parent f4778027d6
commit e2171bbb03

View file

@ -4,7 +4,7 @@
from __future__ import unicode_literals
from six import iteritems
import frappe
from frappe import _
field_map = {
"Contact": [ "first_name", "last_name", "phone", "mobile_no", "email_id", "is_primary_contact" ],
@ -94,6 +94,9 @@ def get_reference_details(reference_doctype, doctype, reference_list, reference_
for d in records:
temp_records.append(d[1:])
if not reference_list:
frappe.throw(_("No records present in {0}".format(reference_doctype)))
reference_details[reference_list[0]][frappe.scrub(doctype)] = temp_records
return reference_details