Odoo 13 CRM Kanban: Hiding Columns for Specific User Groups
Problem: You have a Kanban view in your Odoo 13 CRM module and you want to control which columns are visible to different user groups. For example, you might want sales managers to see a "Sales Stage" column, but not your sales representatives.
Solution: Odoo offers a simple and effective way to control column visibility in Kanban views by leveraging user group permissions. Here's how to achieve this:
Scenario:
Imagine you have a Kanban view for "Leads" in your Odoo 13 CRM, and you want to hide the "Sales Stage" column from sales representatives while making it visible to sales managers.
Original Code:
This is a snippet of how your Kanban view might look in Odoo 13:
<kanban>
<field name="name"/>
<field name="company_id" optional="show"/>
<field name="priority"/>
<field name="stage_id"/>
<field name="contact_name"/>
</kanban>
Analysis and Solution:
-
Define User Groups: Ensure you have your user groups properly defined in Odoo. Create "Sales Representatives" and "Sales Managers" groups if needed.
-
Modify View Access Rights: In your Kanban view configuration, you can add a
groups
attribute to the specific field you want to hide. This attribute takes a string value representing the group that can see the field.<kanban> <field name="name"/> <field name="company_id" optional="show"/> <field name="priority"/> <field name="stage_id" groups="sales.group_sales_manager"/> <field name="contact_name"/> </kanban>
In this example, the
stage_id
field is only visible to users who are members of the "sales.group_sales_manager" group. This group represents your Sales Managers. -
Test and Verify: After making the changes, test the Kanban view by logging in as users from both groups. You should observe the expected result: Sales Managers will see the "Sales Stage" column, while Sales Representatives will not.
Additional Value:
- Granular Control: You can apply this method to hide any field in your Kanban view based on specific user groups.
- Simplified User Experience: By hiding irrelevant information, you can create a cleaner and more user-friendly Kanban view for different user roles.
References:
- Odoo 13 Documentation: This is the official documentation for Odoo 13, providing comprehensive information on various features and functionalities.
- Odoo Community Forum: This forum is a great resource for seeking help and discussions on Odoo related issues.
By following these steps, you can effectively control the visibility of columns in your Odoo 13 CRM Kanban views based on user groups, ensuring a more tailored experience for each role.