mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-24 05:32:46 +01:00
fix: Exclude current record while validating duplicate employee
This commit is contained in:
@@ -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"))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user