update missing salary component abbr

This commit is contained in:
Nabin Hait
2016-11-16 12:55:17 +05:30
parent d65d67e0a7
commit 00e841d744
3 changed files with 41 additions and 17 deletions

View File

@@ -31,6 +31,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -58,8 +59,9 @@
"print_hide_if_no_value": 0,
"print_width": "120px",
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0,
@@ -86,6 +88,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@@ -112,6 +115,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -137,6 +141,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -164,6 +169,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@@ -182,7 +188,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-08-31 08:08:47.359578",
"modified": "2016-11-16 12:44:37.733773",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Component",
@@ -199,6 +205,7 @@
"export": 1,
"if_owner": 0,
"import": 0,
"is_custom": 0,
"permlevel": 0,
"print": 1,
"read": 1,

View File

@@ -10,7 +10,6 @@ from frappe import _
class SalaryComponent(Document):
def validate(self):
self.validate_abbr()
def validate_abbr(self):
if not self.salary_component_abbr:
@@ -21,8 +20,5 @@ class SalaryComponent(Document):
if self.get('__islocal') and len(self.salary_component_abbr) > 5:
frappe.throw(_("Abbreviation cannot have more than 5 characters"))
if not self.salary_component_abbr.strip():
frappe.throw(_("Abbreviation is mandatory"))
if frappe.db.sql("select salary_component_abbr from `tabSalary Component` where name!=%s and salary_component_abbr=%s", (self.name, self.salary_component_abbr)):
frappe.throw(_("Abbreviation already used for another salary component"))