[Fix] Cart remain same even if pos profile change (#12371)

This commit is contained in:
rohitwaghchaure
2018-01-08 15:22:22 +05:30
committed by Nabin Hait
parent bf4c114c58
commit 7fcc21bc8b

View File

@@ -320,7 +320,7 @@ erpnext.pos.PointOfSale = class PointOfSale {
return new Promise((resolve) => { return new Promise((resolve) => {
const on_submit = ({ pos_profile, set_as_default }) => { const on_submit = ({ pos_profile, set_as_default }) => {
if (pos_profile) { if (pos_profile) {
this.frm.doc.pos_profile = pos_profile; this.pos_profile = pos_profile;
} }
if (set_as_default) { if (set_as_default) {
@@ -346,13 +346,19 @@ erpnext.pos.PointOfSale = class PointOfSale {
} }
on_change_pos_profile() { on_change_pos_profile() {
this.set_pos_profile_data() return frappe.run_serially([
.then(() => { () => this.make_sales_invoice_frm(),
this.reset_cart(); () => {
if (this.items) { this.frm.doc.pos_profile = this.pos_profile;
this.items.reset_items(); this.set_pos_profile_data()
} .then(() => {
}); this.reset_cart();
if (this.items) {
this.items.reset_items();
}
});
}
]);
} }
get_promopt_fields() { get_promopt_fields() {