[minor] left aligned email footer, raise duplicate entry error for common email id in Employee and Sales Person
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index 09173f6..79a3ffe 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -90,7 +90,7 @@
]
}
-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">
Sent via ERPNext
</a>
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index 4ba3e96..5a9bad29 100644
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -131,7 +131,7 @@
employee = frappe.db.sql_list("""select name from `tabEmployee` where
user_id=%s and status='Active' and name!=%s""", (self.user_id, self.name))
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):
for l in self.get("leave_approvers")[:]:
diff --git a/erpnext/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py
index 9098aae..5f70b23 100644
--- a/erpnext/setup/doctype/sales_person/sales_person.py
+++ b/erpnext/setup/doctype/sales_person/sales_person.py
@@ -27,7 +27,7 @@
frappe.throw(_("User ID not set for Employee {0}").format(self.employee))
else:
return frappe.db.get_value("User", user, "email") or user
-
+
def validate_employee_id(self):
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)