Salary Copmonent - Default flexible componnent

This commit is contained in:
Jamsheer 2018-05-15 19:03:17 +05:30
parent 15613e46ad
commit 0bc665c0a5
2 changed files with 4 additions and 4 deletions

View File

@ -1001,7 +1001,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-05-16 12:27:03.005070",
"modified": "2018-05-15 18:53:09.115910",
"modified_by": "Administrator",
"module": "HR",
"name": "Salary Component",

View File

@ -11,16 +11,16 @@ from frappe.model.naming import append_number_if_name_exists
class SalaryComponent(Document):
def validate(self):
self.validate_abbr()
self.validate_flexi_defualt()
self.validate_flexi_default()
def validate_flexi_defualt(self):
if self.is_flexible_benefit and self.is_pro_rata_applicable and self.flexi_defualt:
if self.is_flexible_benefit and self.is_pro_rata_applicable and self.flexi_default:
salary_component = frappe.db.exists(
'Salary Component',
{
'is_flexible_benefit': 1,
'is_pro_rata_applicable': 1,
'flexi_defualt': 1
'flexi_default': 1
}
)
if salary_component and salary_component != self.name: