From 14069c9395b64280a5f744f2f2bc7e2b018bb835 Mon Sep 17 00:00:00 2001 From: Shreya Date: Tue, 15 May 2018 15:19:24 +0530 Subject: [PATCH] Fix updation of new values While changing the property of an employee, if the new value is selected from the available values in the link field, it worked properly but on creation of a new linked field value, the new value didn't get updated in the child table. --- erpnext/hr/employee_property_update.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/erpnext/hr/employee_property_update.js b/erpnext/hr/employee_property_update.js index 473916ca42..60d06b41f0 100644 --- a/erpnext/hr/employee_property_update.js +++ b/erpnext/hr/employee_property_update.js @@ -57,7 +57,10 @@ var show_dialog = function(frm, table, field_labels) { primary_action_label: __('Add to Details'), primary_action: () => { d.get_primary_btn().attr('disabled', true); - if(d.data){ + if(d.data) { + var input = $('[data-fieldname="field_html"] input'); + d.data.new = input.val(); + $(input).remove(); add_to_details(frm, d, table); } } @@ -99,11 +102,6 @@ var render_dynamic_field = function(d, fieldtype, options, fieldname) { }); dynamic_field.make_input(); $(dynamic_field.label_area).text(__("New")); - dynamic_field.$input.on("change", function(e) { - d.data.new = e.target.value; - }).on("awesomplete-close", function(e) { - d.data.new = e.target.value; - }); }; var add_to_details = function(frm, d, table) {