Merge pull request #17090 from rohitwaghchaure/pos_qty_decrement_not_working

fix: POS qty decrement freezing the screen
This commit is contained in:
rohitwaghchaure 2019-04-01 14:57:33 +05:30 committed by GitHub
commit f4d8457905
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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