[Fix] Customer and Address blank if does not exist in Delivery Stops (#11895)
This commit is contained in:
parent
7f8df06663
commit
236ac5eb38
@ -104,9 +104,19 @@ frappe.ui.form.on('Delivery Stop', {
|
||||
if (r.message["shipping_address"]) {
|
||||
frappe.model.set_value(cdt, cdn, "address", r.message["shipping_address"].parent);
|
||||
}
|
||||
else {
|
||||
frappe.model.set_value(cdt, cdn, "address", '');
|
||||
}
|
||||
if (r.message["contact_person"]) {
|
||||
frappe.model.set_value(cdt, cdn, "contact", r.message["contact_person"].parent);
|
||||
}
|
||||
else {
|
||||
frappe.model.set_value(cdt, cdn, "contact", '');
|
||||
}
|
||||
}
|
||||
else {
|
||||
frappe.model.set_value(cdt, cdn, "address", '');
|
||||
frappe.model.set_value(cdt, cdn, "contact", '');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -166,11 +166,12 @@ def notify_customers(docname, date, driver, vehicle, sender_email, delivery_noti
|
||||
delivery_notes = (delivery_stop_info.delivery_notes).split(",")
|
||||
attachments = []
|
||||
for delivery_note in delivery_notes:
|
||||
default_print_format = frappe.get_value('Delivery Note', delivery_note, 'default_print_format')
|
||||
attachments.append(
|
||||
frappe.attach_print('Delivery Note',
|
||||
delivery_note,
|
||||
file_name="Delivery Note",
|
||||
print_format='Delivery Note'))
|
||||
print_format=default_print_format or "Standard"))
|
||||
|
||||
if not delivery_stop_info.notified_by_email and contact_info.email_id:
|
||||
driver_info = frappe.db.get_value("Driver", driver, ["full_name", "cell_number"], as_dict=1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user