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 e2fc10cba7..1e121d84db 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() {