fix: reset the incoming rate on changing of the warehouse (#38925)
diff --git a/erpnext/public/js/utils/sales_common.js b/erpnext/public/js/utils/sales_common.js
index 084cca7..b92b02e 100644
--- a/erpnext/public/js/utils/sales_common.js
+++ b/erpnext/public/js/utils/sales_common.js
@@ -184,6 +184,12 @@
refresh_field("incentives",row.name,row.parentfield);
}
+ warehouse(doc, cdt, cdn) {
+ if (doc.docstatus === 0 && doc.is_return && !doc.return_against) {
+ frappe.model.set_value(cdt, cdn, "incoming_rate", 0.0);
+ }
+ }
+
toggle_editable_price_list_rate() {
var df = frappe.meta.get_docfield(this.frm.doc.doctype + " Item", "price_list_rate", this.frm.doc.name);
var editable_price_list_rate = cint(frappe.defaults.get_default("editable_price_list_rate"));