From 7fcc21bc8bc2b7fef809f1a60af54fb51cb41236 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 8 Jan 2018 15:22:22 +0530 Subject: [PATCH] [Fix] Cart remain same even if pos profile change (#12371) --- .../page/point_of_sale/point_of_sale.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 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 e2fc10cba74..1e121d84dbd 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -320,7 +320,7 @@ erpnext.pos.PointOfSale = class PointOfSale { return new Promise((resolve) => { const on_submit = ({ pos_profile, set_as_default }) => { if (pos_profile) { - this.frm.doc.pos_profile = pos_profile; + this.pos_profile = pos_profile; } if (set_as_default) { @@ -346,13 +346,19 @@ erpnext.pos.PointOfSale = class PointOfSale { } on_change_pos_profile() { - this.set_pos_profile_data() - .then(() => { - this.reset_cart(); - if (this.items) { - this.items.reset_items(); - } - }); + return frappe.run_serially([ + () => this.make_sales_invoice_frm(), + () => { + this.frm.doc.pos_profile = this.pos_profile; + this.set_pos_profile_data() + .then(() => { + this.reset_cart(); + if (this.items) { + this.items.reset_items(); + } + }); + } + ]); } get_promopt_fields() {