From e067beda4971e5fce6a8e05a7e54262137aaba38 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 18 Dec 2017 12:32:49 +0530 Subject: [PATCH] [fix] Promise issue, in cart against item displaying zero values (#12078) --- erpnext/selling/page/point_of_sale/point_of_sale.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index 2e690ecf65..b0dd38f3b3 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -193,9 +193,10 @@ erpnext.pos.PointOfSale = class PointOfSale { // add to cur_frm const item = this.frm.add_child('items', args); frappe.flags.hide_serial_batch_dialog = true; - this.frm.script_manager - .trigger('item_code', item.doctype, item.name) - .then(() => { + + frappe.run_serially([ + () => this.frm.script_manager.trigger('item_code', item.doctype, item.name), + () => { const show_dialog = item.has_serial_no || item.has_batch_no; // if actual_batch_qty and actual_qty if then there is only one batch. In such @@ -208,7 +209,8 @@ erpnext.pos.PointOfSale = class PointOfSale { // update cart this.update_cart_data(item); } - }); + } + ]); } select_batch_and_serial_no(item) {