fix: convert asynchronous field update to synchronous (#28906)

Co-authored-by: Dan Navarro on Ubuntu Work <danjeremynavarro@gmail.com>
This commit is contained in:
mro-admin
2021-12-17 05:36:08 -08:00
committed by GitHub
parent 9c2a9c28df
commit c5931e4b1e

View File

@@ -430,12 +430,9 @@ erpnext.utils.select_alternate_items = function(opts) {
qty = row.qty;
}
row[item_field] = d.alternate_item;
frm.script_manager.trigger(item_field, row.doctype, row.name)
.then(() => {
frappe.model.set_value(row.doctype, row.name, 'qty', qty);
frappe.model.set_value(row.doctype, row.name,
opts.original_item_field, d.item_code);
});
frappe.model.set_value(row.doctype, row.name, 'qty', qty);
frappe.model.set_value(row.doctype, row.name, opts.original_item_field, d.item_code);
frm.trigger(item_field, row.doctype, row.name);
});
refresh_field(opts.child_docname);