fix amount not updated when change rate in material request (backport #39606) (#39615)

fix amount not updated when change rate in material request (#39606)

* fix amount not updated when change rate in material request

* make code consistent

(cherry picked from commit efade9b9aee13c4702c69841cdb6766f305d5b30)

Co-authored-by: Jeffry Suryadharma <41689493+jeffrysurya@users.noreply.github.com>
This commit is contained in:
mergify[bot] 2024-01-29 13:36:27 +05:30 committed by GitHub
parent daafe45dd4
commit 9e36ab7de7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -429,6 +429,9 @@ frappe.ui.form.on("Material Request Item", {
rate: function(frm, doctype, name) {
const item = locals[doctype][name];
item.amount = flt(item.qty) * flt(item.rate);
frappe.model.set_value(doctype, name, "amount", item.amount);
refresh_field("amount", item.name, item.parentfield);
frm.events.get_item_data(frm, item, false);
},