diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index f0adfe990e8..9ec15c77cd9 100755 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -1027,11 +1027,7 @@ erpnext.utils.map_current_doc = function (opts) { return; } - if (values.constructor === Array) { - opts.source_name = [...new Set(values)]; - } else { - opts.source_name = values; - } + opts.source_name = Array.isArray(values) ? [...new Set(values)] : values; if ( opts.allow_child_item_selection ||