From d021e45301ee948d8d05176647472304b1246dfd Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Mon, 2 Apr 2018 10:43:19 +0530 Subject: [PATCH] exclude current doc while validating (#13450) --- erpnext/hr/doctype/salary_component/salary_component.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/hr/doctype/salary_component/salary_component.py b/erpnext/hr/doctype/salary_component/salary_component.py index 35d274cd60..9108f31f9b 100644 --- a/erpnext/hr/doctype/salary_component/salary_component.py +++ b/erpnext/hr/doctype/salary_component/salary_component.py @@ -17,6 +17,5 @@ class SalaryComponent(Document): self.salary_component.split()]).upper() self.salary_component_abbr = self.salary_component_abbr.strip() - - self.salary_component_abbr = append_number_if_name_exists('Salary Component', - self.salary_component_abbr, 'salary_component_abbr', separator='_') \ No newline at end of file + self.salary_component_abbr = append_number_if_name_exists('Salary Component', self.salary_component_abbr, + 'salary_component_abbr', separator='_', filters={"name": ["!=", self.name]}) \ No newline at end of file