fix: ensure backend response is awaited before saving

(cherry picked from commit c48db0b7c0)
This commit is contained in:
Sanket322
2025-04-13 13:24:33 +05:30
committed by Mergify
parent 8623a5650b
commit 5a23d7cdca
2 changed files with 3 additions and 3 deletions

View File

@@ -64,7 +64,7 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
&& this.frm.doc.is_pos
&& this.frm.doc.is_return
) {
this.set_total_amount_to_default_mop();
await this.set_total_amount_to_default_mop();
this.calculate_paid_amount();
}

View File

@@ -870,8 +870,8 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
frappe.model.set_value(item.doctype, item.name, "stock_qty", valid_serial_nos.length);
}
validate() {
this.calculate_taxes_and_totals(false);
async validate() {
await this.calculate_taxes_and_totals(false);
}
update_stock() {