Remove sequence order on menu favorite
Instead we order the favorites of a user by descending id. Such that the last favorite set is the first from the list. So user can put a favorite back on top by unset a menu and set it again.
This commit is contained in:
1 parent
50122462ed
commit
a38fc477f5
3 files changed
+4
-6
No files matched your search
@@ -262,7 +262,7 @@ class UIMenu(
|
||||
return menu2favorite
|
||||
|
||||
|
||||
class UIMenuFavorite(sequence_ordered(), ModelSQL, ModelView):
|
||||
class UIMenuFavorite(ModelSQL, ModelView):
|
||||
"Menu Favorite"
|
||||
__name__ = 'ir.ui.menu.favorite'
|
||||
|
||||
@@ -289,7 +289,8 @@ class UIMenuFavorite(sequence_ordered(), ModelSQL, ModelView):
|
||||
user = Transaction().user
|
||||
favorites = cls.search([
|
||||
('user', '=', user),
|
||||
])
|
||||
],
|
||||
order=[('id', 'DESC')])
|
||||
return [(f.menu.id, f.menu.rec_name, f.menu.icon) for f in favorites]
|
||||
|
||||
@classmethod
|
||||
|
||||
@@ -4,8 +4,6 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<form>
|
||||
<label name="menu"/>
|
||||
<field name="menu"/>
|
||||
<label name="sequence"/>
|
||||
<field name="sequence"/>
|
||||
<label name="user"/>
|
||||
<field name="user"/>
|
||||
</form>
|
||||
@@ -1,8 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<tree sequence="sequence">
|
||||
<tree>
|
||||
<field name="menu" expand="1"/>
|
||||
<field name="user" expand="1"/>
|
||||
<field name="sequence" tree_invisible="1"/>
|
||||
</tree>
|
||||
Reference in new issue
Block a user