delivery trip notification to customer fix

This commit is contained in:
Zlash65 2018-10-01 17:28:42 +05:30
parent 9e67b8ec4d
commit 6a5e6ed2ff
2 changed files with 7 additions and 3 deletions

View File

@ -10,7 +10,7 @@ import frappe
from frappe import _
from frappe.contacts.doctype.address.address import get_address_display
from frappe.model.document import Document
from frappe.utils import get_datetime, get_link_to_form
from frappe.utils import get_datetime, get_link_to_form, cstr
class DeliveryTrip(Document):
@ -172,6 +172,10 @@ def notify_customers(delivery_trip):
delivery_trip = frappe.get_doc("Delivery Trip", delivery_trip)
context = delivery_trip.as_dict()
context.update({
"departure_time": cstr(context.get("departure_time")),
"estimated_arrival": cstr(context.get("estimated_arrival"))
})
if delivery_trip.driver:
context.update(frappe.db.get_value("Driver", delivery_trip.driver, "cell_number", as_dict=1))

View File

@ -28,11 +28,11 @@
</tr>
<tr>
<td>Departure Time</td>
<td>{{ cstr(departure_time) }}</td>
<td>{{ departure_time }}</td>
</tr>
<tr>
<td>Estimated Arrival</td>
<td>{{ cstr(estimated_arrival) }}</td>
<td>{{ estimated_arrival }}</td>
</tr>
<tr>
<td>Driver's Name</td>