lass AmountLimit(models.Model):
_name = 'amount.approval'
_description = 'Amount Approval'
user_id = fields.Many2one(comodel_name="res.users",
string='Name', required=True)
amount = fields.Float('Amount Limit')
this is my amount.approval model
here is menu
access_amount_approval,access_amount_approval,model_amount_approval,base.group_user,1,1,1,1
here is security access
now this amount limit menu i want to see only for admin access only admin can see this menu
how I do this?
please help me
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project
- MRP
This question has been flagged
DO I need to create any group for this?
if yes
then How I do this
parent="menu_multi_approval" sequence="110"
action="amount_approver_limit_action"
/>
here is my menu can you give me whatother I need to do
full guideline or full code
You dont need to create just use the existing groups, use any one: base.group_erp_manager (Access rights) or base.group_system (Settings)
add groups="base.group_erp_manager"
so now your menu should look like as follows:
parent="menu_multi_approval" sequence="110"
action="amount_approver_limit_action" groups="base.group_erp_manager"
after the change upgrade the module
I update with your recommendation code
After that what should I do ?
Hi,
You can set the groups attribute for the menu item, so that the menu wont be accessible by other users.
If you set a group for the menu, only the users in the group will see the menu item.
This can be done from the user interface and as well as code. So here you can either assign the base.group_erp_manager (Access rights) or base.group_system (Settings) group for the menu.
Sample:
id="crm_config_settings_menu"
name="Settings"
parent="crm_menu_config"
action="crm.crm_config_settings_action"
groups="base.group_system"
sequence="0"/>
Similarly if the model data also has to be access only by admin, you can change group assigned in the access right also, change the base.group_user from the csv (access rights) to the admin group.
Thanks
Hi,
If you want to restrict a menu item to specific groups, you can add a 'groups' attribute to the menuitem component.
For example:
<menuitem
id="calendar_appointment_type_menu_action"
parent="calendar.mail_menu_calendar"
name="Calendar"
sequence="3"
action="calendar.action_calendar_event"
groups="base.group_erp_manager"/>
Now, the menu item will only be visible to users belonging to the 'base.group_erp_manager' group.
Hope it helps
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up