Hi,
How can i add a field in user settings form and make a menu item visible based on this field.
Thanks in advance.
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
This question has been flagged
Hi,
refer the following forum post https://www.odoo.com/forum/help-1/question/how-to-hide-employee-menu-item-on-a-specific-user-group-140510
Thanks
Hi,
Boolean fields that we see in the users form are the groups in the database, suppose if you need to see a check Box named XYZ in the users form view and if you need to make a menu named ABCD visible only for the users, if the XYZ is ticked, what you have to do is that Create a group named XYZ(either you can do it from ui or from the code), so once the new group is created it will be visible in the users form view.
Now you have to take the menu and add this newly created group to it(either from ui or code).
For creating group from the user interface, you can do it from: Settings -> User & Companies -> Groups(Make sure that the debug mode is activated)
From Code:
<record id="group_xyz" model="res.groups">
<field name="name">XYZ</field>
</record>
To add this group to the menu from UI: Settings -> Technical -> User Interface -> Menu items, search the menu and open it, in the Access rights tab you can see the groups(if there is already some groups, either you can keep it as such or remove it and add the newly created group to it.
From the Code:
<record id="menu_abcd" model="ir.ui.menu">
<field name="groups_id" eval="[(4, ref('group_xyz'))]"/>
</record>
Thanks
Hello Peter,
You can do a bit of modification in search method of ir.ui.menu
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
5
Jun 24
|
20741 | ||
|
1
Mar 19
|
5306 | ||
|
0
Mar 19
|
2945 | ||
|
0
May 15
|
2419 | ||
|
0
Jan 24
|
1979 |