fix: do not clear promotion/transfer details if doc is amended (#32000)
This commit is contained in:
@@ -9,7 +9,7 @@ frappe.ui.form.on(cur_frm.doctype, {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
onload: function(frm) {
|
onload: function(frm) {
|
||||||
if(frm.doc.__islocal){
|
if (frm.doc.__islocal && !frm.doc.amended_from) {
|
||||||
if (frm.doctype == "Employee Promotion") {
|
if (frm.doctype == "Employee Promotion") {
|
||||||
frm.doc.promotion_details = [];
|
frm.doc.promotion_details = [];
|
||||||
} else if (frm.doctype == "Employee Transfer") {
|
} else if (frm.doctype == "Employee Transfer") {
|
||||||
@@ -123,6 +123,8 @@ var add_to_details = function(frm, d, table) {
|
|||||||
new: data.new
|
new: data.new
|
||||||
});
|
});
|
||||||
frm.refresh_field(table);
|
frm.refresh_field(table);
|
||||||
|
frm.fields_dict[table].grid.wrapper.find(".grid-add-row").hide();
|
||||||
|
|
||||||
d.fields_dict.field_html.$wrapper.html("");
|
d.fields_dict.field_html.$wrapper.html("");
|
||||||
d.set_value("property", "");
|
d.set_value("property", "");
|
||||||
d.set_value('current', "");
|
d.set_value('current', "");
|
||||||
|
|||||||
Reference in New Issue
Block a user