fix: pos item cart dom updates (#26459)

This commit is contained in:
Saqib 2021-07-13 14:09:06 +05:30 committed by GitHub
parent a8b6cf8114
commit 7c5711ddf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -965,8 +965,23 @@ erpnext.PointOfSale.ItemCart = class {
});
}
attach_refresh_field_event(frm) {
$(frm.wrapper).off('refresh-fields');
$(frm.wrapper).on('refresh-fields', () => {
if (frm.doc.items.length) {
frm.doc.items.forEach(item => {
this.update_item_html(item);
});
}
this.update_totals_section(frm);
});
}
load_invoice() {
const frm = this.events.get_frm();
this.attach_refresh_field_event(frm);
this.fetch_customer_details(frm.doc.customer).then(() => {
this.events.customer_details_updated(this.customer_info);
this.update_customer_section();