From 947a63c4567aa4b247ad55f5c9986d5502d09f2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 16 Jan 2026 10:07:03 +0100 Subject: [PATCH] Make the user menu favorites unique Closes #14213 --- trytond/trytond/ir/ui/menu.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/trytond/trytond/ir/ui/menu.py b/trytond/trytond/ir/ui/menu.py index 3e331d4cee..77eec57df6 100644 --- a/trytond/trytond/ir/ui/menu.py +++ b/trytond/trytond/ir/ui/menu.py @@ -1,6 +1,6 @@ # This file is part of Tryton. The COPYRIGHT file at the top level of # this repository contains the full copyright notices and license terms. -from collections import defaultdict +from collections import OrderedDict, defaultdict from itertools import groupby from trytond.model import ( @@ -306,7 +306,8 @@ class UIMenuFavorite(ModelSQL): ('user', '=', user), ], order=[('id', 'DESC')]) - return [(f.menu.id, f.menu.rec_name, f.menu.icon) for f in favorites] + return list(OrderedDict.fromkeys( + (f.menu.id, f.menu.rec_name, f.menu.icon) for f in favorites)) @classmethod def set(cls, menu_id):