fix: do not clear promotion/transfer details if doc is amended (#32000)

This commit is contained in:
Rucha Mahabal
2022-08-29 12:10:15 +05:30
committed by GitHub
parent 8eded437d2
commit 074d484d3c

View File

@@ -9,7 +9,7 @@ frappe.ui.form.on(cur_frm.doctype, {
});
},
onload: function(frm) {
if(frm.doc.__islocal){
if (frm.doc.__islocal && !frm.doc.amended_from) {
if (frm.doctype == "Employee Promotion") {
frm.doc.promotion_details = [];
} else if (frm.doctype == "Employee Transfer") {
@@ -123,6 +123,8 @@ var add_to_details = function(frm, d, table) {
new: data.new
});
frm.refresh_field(table);
frm.fields_dict[table].grid.wrapper.find(".grid-add-row").hide();
d.fields_dict.field_html.$wrapper.html("");
d.set_value("property", "");
d.set_value('current', "");