mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 07:29:22 +00: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()
|
self.validate_duplicate_employee()
|
||||||
|
|
||||||
def validate_duplicate_employee(self):
|
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"))
|
frappe.throw(_("Employee ID is linked with another instructor"))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user