From 9ad79625e02772a6c72b5eacfd7ebf5f38706675 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Mon, 9 Dec 2024 12:37:36 +0530 Subject: [PATCH] fix: description overwrite on qty change (#44606) --- erpnext/stock/doctype/material_request/material_request.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index 949c77c8eb79..d557116961c5 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -267,18 +267,21 @@ frappe.ui.form.on("Material Request", { }, callback: function (r) { const d = item; - const allow_to_change_fields = [ + let allow_to_change_fields = [ "actual_qty", "projected_qty", "min_order_qty", "item_name", - "description", "stock_uom", "uom", "conversion_factor", "stock_qty", ]; + if (overwrite_warehouse) { + allow_to_change_fields.push("description"); + } + if (!r.exc) { $.each(r.message, function (key, value) { if (!d[key] || allow_to_change_fields.includes(key)) {