[IMP] base: Order user's type groups by id
Purpose ======= Traceback when following these steps: - Install MRP - Load French translations - Set language to French - Activate 'work orders' on MRP configuration Error: The field 'sel_groups_9_10_1' doesn't exist. This is because the only selection groups field on the res_users view that doesn't have a transitive closure (the user's type Internal/Portal/Public) is ordered by name. 1: Internal User 9: Portal 10: Public becomes 9: Portail 10: Public 1: Utilisateur Interne which lead to the traceback. We should retrieve these groups ordered by 'id' to avoid the issue.
This commit is contained in:
@@ -920,7 +920,7 @@ class GroupsView(models.Model):
|
||||
def linearize(app, gs):
|
||||
# 'User Type' is an exception
|
||||
if app.xml_id == 'base.module_category_user_type':
|
||||
return (app, 'selection', gs)
|
||||
return (app, 'selection', gs.sorted('id'))
|
||||
# determine sequence order: a group appears after its implied groups
|
||||
order = {g: len(g.trans_implied_ids & gs) for g in gs}
|
||||
# check whether order is total, i.e., sequence orders are distinct
|
||||
|
||||
Reference in New Issue
Block a user