From b3fef6a72a0742f778eb57a33aa11c55dd214db1 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Thu, 20 Sep 2018 16:13:11 +0200 Subject: [PATCH] [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. --- odoo/addons/base/models/res_users.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/res_users.py b/odoo/addons/base/models/res_users.py index 4ca5f98d0ee..aabbc4ffdd6 100644 --- a/odoo/addons/base/models/res_users.py +++ b/odoo/addons/base/models/res_users.py @@ -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