Added warning
Added a warning to show a information to the active user
This commit is contained in:
parent
28453efece
commit
4e7b52952e
@ -47,12 +47,19 @@ class MaintenanceSchedule(TransactionBase):
|
|||||||
self.validate_serial_no(serial_nos, d.start_date)
|
self.validate_serial_no(serial_nos, d.start_date)
|
||||||
self.update_amc_date(serial_nos, d.end_date)
|
self.update_amc_date(serial_nos, d.end_date)
|
||||||
|
|
||||||
|
no_email_sp = []
|
||||||
if d.sales_person not in email_map:
|
if d.sales_person not in email_map:
|
||||||
sp = frappe.get_doc("Sales Person", d.sales_person)
|
sp = frappe.get_doc("Sales Person", d.sales_person)
|
||||||
try:
|
try:
|
||||||
email_map[d.sales_person] = sp.get_email_id()
|
email_map[d.sales_person] = sp.get_email_id()
|
||||||
except frappe.ValidationError:
|
except frappe.ValidationError:
|
||||||
pass
|
no_email_sp.append(d.sales_person)
|
||||||
|
|
||||||
|
if no_email_sp:
|
||||||
|
frappe.msgprint(
|
||||||
|
"Setting Events to <b>{0}</b>, since the Employee attached to the below Sales Persons does not have a User ID<br>{1}".format(
|
||||||
|
doc.owner, no_email_sp.join("<br>")
|
||||||
|
))
|
||||||
|
|
||||||
scheduled_date = frappe.db.sql("""select scheduled_date from
|
scheduled_date = frappe.db.sql("""select scheduled_date from
|
||||||
`tabMaintenance Schedule Detail` where sales_person=%s and item_code=%s and
|
`tabMaintenance Schedule Detail` where sales_person=%s and item_code=%s and
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user