From c159e3b06f86b16cbf6ff8b2e28060451e1454f0 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 17 Jun 2024 12:48:33 +0530 Subject: [PATCH] fix: duplicate rows fetching in RFQ (cherry picked from commit 555510c128a2f13181c4b27475bf7326f232ab34) --- erpnext/public/js/utils.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index fcb541f71a8c..a7d88edcafab 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -933,7 +933,13 @@ erpnext.utils.map_current_doc = function (opts) { frappe.msgprint(__("Please select {0}", [opts.source_doctype])); return; } - opts.source_name = values; + + if (values.constructor === Array) { + opts.source_name = [...new Set(values)]; + } else { + opts.source_name = values; + } + if ( opts.allow_child_item_selection || ["Purchase Receipt", "Delivery Note"].includes(opts.source_doctype)