Merge pull request #34489 from akhilnarang/fix-communication-relink-comma
fix: deduplicate doctypes in `get_communication_doctype`
This commit is contained in:
commit
69b857a8f4
2 changed files with 4 additions and 2 deletions
|
|
@ -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])
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue