[minor] left aligned email footer, raise duplicate entry error for common email id in Employee and Sales Person
This commit is contained in:
parent
8ea1ed143b
commit
7b6daafbb9
@ -90,7 +90,7 @@ scheduler_events = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
default_mail_footer = """<div style="padding: 7px; margin-top: 7px; text-align: center;">
|
default_mail_footer = """<div style="padding: 7px; margin-top: 7px;">
|
||||||
<a style="color: #8D99A6; font-size: 85%; text-decoration: none;" href="https://erpnext.com" target="_blank">
|
<a style="color: #8D99A6; font-size: 85%; text-decoration: none;" href="https://erpnext.com" target="_blank">
|
||||||
Sent via ERPNext
|
Sent via ERPNext
|
||||||
</a>
|
</a>
|
||||||
|
@ -131,7 +131,7 @@ class Employee(Document):
|
|||||||
employee = frappe.db.sql_list("""select name from `tabEmployee` where
|
employee = frappe.db.sql_list("""select name from `tabEmployee` where
|
||||||
user_id=%s and status='Active' and name!=%s""", (self.user_id, self.name))
|
user_id=%s and status='Active' and name!=%s""", (self.user_id, self.name))
|
||||||
if employee:
|
if employee:
|
||||||
throw(_("User {0} is already assigned to Employee {1}").format(self.user_id, employee[0]))
|
throw(_("User {0} is already assigned to Employee {1}").format(self.user_id, employee[0]), frappe.DuplicateEntryError)
|
||||||
|
|
||||||
def validate_employee_leave_approver(self):
|
def validate_employee_leave_approver(self):
|
||||||
for l in self.get("leave_approvers")[:]:
|
for l in self.get("leave_approvers")[:]:
|
||||||
|
@ -27,7 +27,7 @@ class SalesPerson(NestedSet):
|
|||||||
frappe.throw(_("User ID not set for Employee {0}").format(self.employee))
|
frappe.throw(_("User ID not set for Employee {0}").format(self.employee))
|
||||||
else:
|
else:
|
||||||
return frappe.db.get_value("User", user, "email") or user
|
return frappe.db.get_value("User", user, "email") or user
|
||||||
|
|
||||||
def validate_employee_id(self):
|
def validate_employee_id(self):
|
||||||
if frappe.db.exists({"doctype": "Sales Person","employee": self.employee}):
|
if frappe.db.exists({"doctype": "Sales Person","employee": self.employee}):
|
||||||
frappe.throw("Another sales person with the same employee id exists.")
|
frappe.throw("Another sales person with the same employee id exists.", frappe.DuplicateEntryError)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user