[minor] left aligned email footer, raise duplicate entry error for common email id in Employee and Sales Person

This commit is contained in:
Anand Doshi
2015-04-01 16:26:59 +05:30
parent 8ea1ed143b
commit 7b6daafbb9
3 changed files with 4 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ class SalesPerson(NestedSet):
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)