fix: code improvement, match error type for message
This commit is contained in:
parent
5fe3abcfae
commit
5db99e0649
@ -92,7 +92,7 @@ frappe.ui.form.on('Process Statement Of Accounts', {
|
||||
frm.refresh_field('customers');
|
||||
}
|
||||
else{
|
||||
frappe.msgprint('No Customers found with selected options.');
|
||||
frappe.throw('No Customers found with selected options.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -126,13 +126,11 @@ def get_customers_based_on_sales_person(sales_person):
|
||||
sales_person_records = frappe._dict()
|
||||
for d in records:
|
||||
sales_person_records.setdefault(d.parenttype, set()).add(d.parent)
|
||||
|
||||
try:
|
||||
customers = frappe.get_list('Customer', fields=['name', 'email_id'], \
|
||||
if sales_person_records.get('Customer'):
|
||||
return frappe.get_list('Customer', fields=['name', 'email_id'], \
|
||||
filters=[['name', 'in', list(sales_person_records['Customer'])]])
|
||||
except:
|
||||
customers = []
|
||||
return customers
|
||||
else:
|
||||
return []
|
||||
|
||||
def get_recipients_and_cc(customer, doc):
|
||||
recipients = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user