fix: POS qty decrement freezing the screen

This commit is contained in:
Rohit Waghchaure 2019-04-01 14:29:55 +05:30
parent 48bca9fbf2
commit e994494e3e

View File

@ -233,13 +233,16 @@ erpnext.pos.PointOfSale = class PointOfSale {
} else { } else {
this.update_item_in_frm(item, field, value) this.update_item_in_frm(item, field, value)
.then(() => { .then(() => {
this.frm.doc.items.forEach(item_row => { frappe.dom.unfreeze();
// update cart let items = this.frm.doc.items.map(item => item.idx);
frappe.run_serially([ if (items && items.length > 0 && items.indexOf(item.idx)) {
() => this.update_cart_data(item_row), this.frm.doc.items.forEach(item_row => {
() => this.set_form_action() // update cart
]); this.on_qty_change(item_row);
}); });
} else {
this.on_qty_change(item);
}
}); });
} }
return; return;
@ -280,6 +283,13 @@ erpnext.pos.PointOfSale = class PointOfSale {
]); ]);
} }
on_qty_change(item) {
frappe.run_serially([
() => this.update_cart_data(item),
() => this.set_form_action()
]);
}
select_batch_and_serial_no(row) { select_batch_and_serial_no(row) {
frappe.dom.unfreeze(); frappe.dom.unfreeze();