mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
Add patch to fix issue4542
This commit is contained in:
parent
aed2a21cdc
commit
e0c99e58fa
32
issue14971002_1.diff
Normal file
32
issue14971002_1.diff
Normal file
|
@ -0,0 +1,32 @@
|
|||
# HG changeset patch
|
||||
# User Guillem Barba <guillembarba@gmail.com>
|
||||
don't remove elements from tuple on group's menu field getter
|
||||
|
||||
issue4542
|
||||
review14971002
|
||||
|
||||
Index: trytond/trytond/res/group.py
|
||||
===================================================================
|
||||
|
||||
--- a/trytond/trytond/res/group.py
|
||||
+++ b/trytond/trytond/res/group.py
|
||||
@@ -24,11 +24,13 @@
|
||||
('id', 'in', sub_ids),
|
||||
])))
|
||||
menu_ids = set(chain(*test_ids))
|
||||
- for ids in res.itervalues():
|
||||
- for id_ in ids[:]:
|
||||
- if id_ not in menu_ids:
|
||||
- ids.remove(id_)
|
||||
- return res
|
||||
+ new_res = {}
|
||||
+ for group_id, ids in res.iteritems():
|
||||
+ new_res[group_id] = []
|
||||
+ for id_ in ids:
|
||||
+ if id_ in menu_ids:
|
||||
+ new_res[group_id].append(id_)
|
||||
+ return new_res
|
||||
|
||||
|
||||
class Group(ModelSQL, ModelView):
|
||||
|
Loading…
Reference in a new issue