Skip to content

Commit

Permalink
fix: do not reset the basic rate for the material receipt stock entry…
Browse files Browse the repository at this point in the history
… (backport #38896) (#38899)

fix: do not reset the basic rate for the material receipt stock entry (#38896)

(cherry picked from commit 98bfcc4)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
  • Loading branch information
mergify[bot] and rohitwaghchaure authored Dec 21, 2023
1 parent 135aced commit f6eb2b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion erpnext/stock/doctype/stock_entry/stock_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,12 @@ frappe.ui.form.on('Stock Entry', {
},
callback: function(r) {
if (!r.exc) {
["actual_qty", "basic_rate"].forEach((field) => {
let fields = ["actual_qty", "basic_rate"];
if (frm.doc.purpose == "Material Receipt") {
fields = ["actual_qty"];
}

fields.forEach((field) => {
frappe.model.set_value(cdt, cdn, field, (r.message[field] || 0.0));
});
frm.events.calculate_basic_amount(frm, child);
Expand Down

0 comments on commit f6eb2b5

Please sign in to comment.