fix: Revert #frappe/erpnext/17896 (#18251)
diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js
index cf48be4..0cd648e 100755
--- a/erpnext/public/js/utils.js
+++ b/erpnext/public/js/utils.js
@@ -573,7 +573,6 @@
if(!r.exc) {
var doc = frappe.model.sync(r.message);
cur_frm.dirty();
- erpnext.utils.clear_duplicates();
cur_frm.refresh();
}
}
@@ -604,28 +603,6 @@
}
}
-erpnext.utils.clear_duplicates = function() {
- if(!cur_frm.doc.items) return;
- const unique_items = new Map();
- /*
- Create a Map of items with
- item_code => [qty, warehouse, batch_no]
- */
- let items = [];
-
- for (let item of cur_frm.doc.items) {
- if (!(unique_items.has(item.item_code) && unique_items.get(item.item_code)[0] === item.qty &&
- unique_items.get(item.item_code)[1] === item.warehouse && unique_items.get(item.item_code)[2] === item.batch_no &&
- unique_items.get(item.item_code)[3] === item.delivery_date && unique_items.get(item.item_code)[4] === item.required_date &&
- unique_items.get(item.item_code)[5] === item.rate)) {
-
- unique_items.set(item.item_code, [item.qty, item.warehouse, item.batch_no, item.delivery_date, item.required_date, item.rate]);
- items.push(item);
- }
- }
- cur_frm.doc.items = items;
-}
-
frappe.form.link_formatters['Item'] = function(value, doc) {
if(doc && doc.item_name && doc.item_name !== value) {
return value? value + ': ' + doc.item_name: doc.item_name;