Merge pull request #23828 from abhishekbalam/psoa_testcase_fix
fix(PSOA): key error if no customers found
This commit is contained in:
commit
48d9173a55
@ -92,7 +92,7 @@ frappe.ui.form.on('Process Statement Of Accounts', {
|
|||||||
frm.refresh_field('customers');
|
frm.refresh_field('customers');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
frappe.msgprint('No Customers found with selected options.');
|
frappe.throw('No Customers found with selected options.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,9 +126,11 @@ def get_customers_based_on_sales_person(sales_person):
|
|||||||
sales_person_records = frappe._dict()
|
sales_person_records = frappe._dict()
|
||||||
for d in records:
|
for d in records:
|
||||||
sales_person_records.setdefault(d.parenttype, set()).add(d.parent)
|
sales_person_records.setdefault(d.parenttype, set()).add(d.parent)
|
||||||
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'])]])
|
filters=[['name', 'in', list(sales_person_records['Customer'])]])
|
||||||
return customers
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
def get_recipients_and_cc(customer, doc):
|
def get_recipients_and_cc(customer, doc):
|
||||||
recipients = []
|
recipients = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user