mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-27 17:04:47 +00:00
fix: clear property child table on changing employee
This commit is contained in:
@@ -10,13 +10,20 @@ frappe.ui.form.on(cur_frm.doctype, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onload: function(frm) {
|
onload: function(frm) {
|
||||||
if (frm.doc.__islocal) {
|
if (frm.doc.__islocal)
|
||||||
if (frm.doctype == "Employee Promotion") {
|
frm.trigger("clear_property_table");
|
||||||
frm.clear_table("promotion_details");
|
},
|
||||||
} else if (frm.doctype == "Employee Transfer") {
|
|
||||||
frm.clear_table("transfer_details");
|
employee: function(frm) {
|
||||||
}
|
frm.trigger("clear_property_table");
|
||||||
}
|
},
|
||||||
|
|
||||||
|
clear_property_table: function(frm) {
|
||||||
|
let table = (frm.doctype == "Employee Promotion") ? "promotion_details" : "transfer_details";
|
||||||
|
frm.clear_table(table);
|
||||||
|
frm.refresh_field(table);
|
||||||
|
|
||||||
|
frm.fields_dict[table].grid.wrapper.find(".grid-add-row").hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
|
|||||||
Reference in New Issue
Block a user