From 0d9c151d9f61d03e57f815d99158e1b90c9dca5e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 24 Dec 2019 18:06:49 +0530 Subject: [PATCH] fix: Exclude current record while validating duplicate employee --- erpnext/education/doctype/instructor/instructor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/education/doctype/instructor/instructor.py b/erpnext/education/doctype/instructor/instructor.py index 058d476f5b..28df2fcdc1 100644 --- a/erpnext/education/doctype/instructor/instructor.py +++ b/erpnext/education/doctype/instructor/instructor.py @@ -27,7 +27,7 @@ class Instructor(Document): self.validate_duplicate_employee() def validate_duplicate_employee(self): - if self.employee and frappe.db.get_value("Instructor", {'employee': self.employee}, 'name'): + if self.employee and frappe.db.get_value("Instructor", {'employee': self.employee, 'name': ['!=', self.name]}, 'name'): frappe.throw(_("Employee ID is linked with another instructor"))