Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I would like to know how to hide a view type like Kanban from a particular group. Is there a way to do this? I tried a couple ways that I thought would work, but for some reason it is still showing the Kanban view for the unwanted group.
Here is one method that I tried:
<record model="ir.ui.view" id="project.view_project_kanban">
<field name="groups_id" eval="[(6,0,[ref('group1'),ref('group2'),ref('group3')])]" />
I thought by adding groups the the view's group_ids field would only allow users in those groups to see the Kanban view, but it still is showing the view to the unwanted group.
Another method that I tried was to inherit the Kanban view and add a groups attribute to the <kanban> tag like this:
<record id="project_kanban_view_inherit" model="ir.ui.view">
<field name="name">Project Kanban Inherited</field>
<field name="inherit_id" ref="project.view_project_kanban" />
<field name="arch" type="xml">
<xpath expr="/kanban" position="attributes">
I thought this would work like the first example that I tried, but it still is showing the Kanban view for the unwanted group.
Does anyone know how I can hide a view from an unwanted group? Thank you
Hello Eric, sorry if this reply does not answer your original question, I just want to clarify what I have figured out about the field 'groups_id' in the 'ir.ui.view' object.
After reviewing ORM and 'ir.ui.view' sources and their history, I've arrived to the conclusion that its current usage is limited to filter inheriting views (despite the fact that the documentation claims a more general usage):
- The field was introduced at Aug 29, 2012
- Some hours later, the routine that retrieves the inheriting views and their ids was modified to filter by groups
- After the introduction of this field, some inheriting views have been modified to be filtered by groups
After a quick search, I've verified that Odoo official modules only use 'groups_id' in inheriting views, here's another example. If modifying existing views based in groups membership partially suits your needs, you may give a try.
The 'ir.actions.act_window' object also has a 'groups_id' field, but I don't know what is its purpose, you may give a try as well.
If anyone else knows something else about the field 'groups_id' in the 'ir.ui.view' and the 'ir.actions.act_window' objects, please let us know.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 11/17/14, 1:38 PM|
|Seen: 1894 times|
|Last updated: 8/12/15, 10:42 AM|