fix Leave Encashment unlink additional component, readonly encashed days

This commit is contained in:
Ranjith 2018-05-15 20:11:30 +05:30
parent c60c6981a5
commit d43e068a5b
2 changed files with 4 additions and 2 deletions

View File

@ -454,6 +454,7 @@
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "eval:doc.total_leaves_encashed>0",
"fieldname": "total_leaves_encashed",
"fieldtype": "Float",
"hidden": 0,
@ -470,7 +471,7 @@
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
@ -588,7 +589,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-05-15 17:06:18.343451",
"modified": "2018-05-15 20:04:56.901123",
"modified_by": "Administrator",
"module": "HR",
"name": "Leave Allocation",

View File

@ -44,6 +44,7 @@ class LeaveEncashment(Document):
def on_cancel(self):
if self.additional_component:
frappe.get_doc("Additional Salary Component", self.additional_component).cancel()
self.db_set("additional_component", "")
if self.leave_allocation:
frappe.db.set_value("Leave Allocation", self.leave_allocation, "total_leaves_encashed",