fix: allow addition and removal of employee in payroll Entry

This commit is contained in:
Anurag Mishra 2020-12-17 15:17:25 +05:30
parent 0411a43c6e
commit d556847fca
3 changed files with 24 additions and 24 deletions

View File

@ -17,8 +17,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Employee", "label": "Employee",
"options": "Employee", "options": "Employee"
"read_only": 1
}, },
{ {
"fetch_from": "employee.employee_name", "fetch_from": "employee.employee_name",
@ -52,7 +51,7 @@
], ],
"istable": 1, "istable": 1,
"links": [], "links": [],
"modified": "2020-09-30 12:40:07.999878", "modified": "2020-12-17 15:43:29.542977",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Payroll", "module": "Payroll",
"name": "Payroll Employee Detail", "name": "Payroll Employee Detail",

View File

@ -70,18 +70,18 @@ frappe.ui.form.on('Payroll Entry', {
render_employee_attendance(frm, r.message); render_employee_attendance(frm, r.message);
} }
} }
}) });
}, },
create_salary_slips: function(frm) { create_salary_slips: function(frm) {
frm.call({ frm.call({
doc: frm.doc, doc: frm.doc,
method: "create_salary_slips", method: "create_salary_slips",
callback: function(r) { callback: function() {
frm.refresh(); frm.refresh();
frm.toolbar.refresh(); frm.toolbar.refresh();
} }
}) });
}, },
add_context_buttons: function(frm) { add_context_buttons: function(frm) {
@ -274,7 +274,9 @@ const submit_salary_slip = function (frm) {
frappe.call({ frappe.call({
method: 'submit_salary_slips', method: 'submit_salary_slips',
args: {}, args: {},
callback: function() {frm.events.refresh(frm);}, callback: function() {
frm.events.refresh(frm);
},
doc: frm.doc, doc: frm.doc,
freeze: true, freeze: true,
freeze_message: __('Submitting Salary Slips and creating Journal Entry...') freeze_message: __('Submitting Salary Slips and creating Journal Entry...')
@ -316,4 +318,4 @@ let render_employee_attendance = function(frm, data) {
data: data data: data
}) })
); );
} };

View File

@ -129,8 +129,7 @@
"fieldname": "employees", "fieldname": "employees",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Employee Details", "label": "Employee Details",
"options": "Payroll Employee Detail", "options": "Payroll Employee Detail"
"read_only": 1
}, },
{ {
"fieldname": "section_break_13", "fieldname": "section_break_13",
@ -290,7 +289,7 @@
"icon": "fa fa-cog", "icon": "fa fa-cog",
"is_submittable": 1, "is_submittable": 1,
"links": [], "links": [],
"modified": "2020-10-23 13:00:33.753228", "modified": "2020-12-17 15:13:17.766210",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Payroll", "module": "Payroll",
"name": "Payroll Entry", "name": "Payroll Entry",