diff --git a/base_user_role/__openerp__.py b/base_user_role/__openerp__.py index 1482f0b53..cad49b7bf 100644 --- a/base_user_role/__openerp__.py +++ b/base_user_role/__openerp__.py @@ -15,6 +15,7 @@ ], 'data': [ 'security/ir.model.access.csv', + 'data/ir_module_category.xml', 'data/ir_cron.xml', 'views/role.xml', 'views/user.xml', diff --git a/base_user_role/data/ir_module_category.xml b/base_user_role/data/ir_module_category.xml new file mode 100644 index 000000000..53a51f9a8 --- /dev/null +++ b/base_user_role/data/ir_module_category.xml @@ -0,0 +1,12 @@ + + + + + + + User roles + + + + diff --git a/base_user_role/models/role.py b/base_user_role/models/role.py index 6cbf42b97..861539b85 100644 --- a/base_user_role/models/role.py +++ b/base_user_role/models/role.py @@ -24,6 +24,12 @@ class ResUsersRole(models.Model): user_ids = fields.One2many( 'res.users', string=u"Users", compute='_compute_user_ids') + _defaults = { # pylint: disable=attribute-deprecated + 'category_id': api.model( + lambda cls: cls.env.ref( + 'base_user_role.ir_module_category_role').id), + } + @api.multi @api.depends('line_ids.user_id') def _compute_user_ids(self):