Merge pull request #34489 from akhilnarang/fix-communication-relink-comma

fix: deduplicate doctypes in `get_communication_doctype`
This commit is contained in:
Akhil Narang 2025-10-24 17:50:53 +05:30 committed by GitHub
commit 69b857a8f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -100,7 +100,7 @@ def get_communication_doctype(doctype, txt, searchfield, start, page_len, filter
results = []
txt_lower = txt.lower().replace("%", "")
for dt in com_doctypes:
for dt in list(set(com_doctypes)):
if dt in can_read:
if txt_lower in dt.lower() or txt_lower in _(dt).lower():
results.append([dt])

View file

@ -441,7 +441,9 @@ frappe.ui.form.ControlLink = class ControlLink extends frappe.ui.form.ControlDat
if (newArr.length === 0) return [currElem];
let element_with_same_value = newArr.find((e) => e.value === currElem.value);
if (element_with_same_value) {
element_with_same_value.description += `, ${currElem.description}`;
if (currElem.description) {
element_with_same_value.description += `, ${currElem.description}`;
}
return [...newArr];
}
return [...newArr, currElem];