Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Why my menu item still visible for all user same as admin, even I have already make the security groups and also set the groups in menuitem

Subscribe

Get notified when there's activity on this post

This question has been flagged
securitymenuitem
3 Replies
4182 Views
Avatar
Alvin Risman

Here is the code

// security/user_groups.xml

<?xml version="1.0" encoding="utf-8"?>

<odoo>

    <data>

        <record model="ir.module.category" id="module_management">

            <field name="name">Hotel Permission</field>

            <field name="description">Access Security</field>

            <field name="sequence">3</field>

        </record>

        <record id="group_admin" model="res.groups">

            <field name="name">Admin</field>

            <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>

            <field name="users" eval="[(4, ref('base.user_root'))]"/>

            <field name="category_id" ref="module_management"/>

        </record>

        <record id="group_user_receptionist" model="res.groups">

            <field name="name">User</field>

            <field name="implied_ids" eval="[(4, ref('hotel.group_admin'))]"/>

            <field name="category_id" ref="module_management"/>

        </record>

      </data>

</odoo>


// views/hotel.xml

<?xml version='1.0' encoding='utf-8'?>

<odoo>

    <data>

        <!-- Add you code here -->

        <!-- hotel.room tree view -->

        <record id="room_view_tree" model="ir.ui.view">

            <field name="name">hotel.room.view.tree</field>

            <field name="model">hotel.room</field>

            <field name="arch" type="xml">

                <tree>

                    <!-- Add your fields here -->

                    <field name="room_number"/>

                    <field name="room_type"/>

                    <field name="room_price"/>

                </tree>

            </field>

        </record>


        <!-- hotel.room form view -->

        <record id="room_view_form" model="ir.ui.view">

            <field name="name">hotel.room.view.form</field>

            <field name="model">hotel.room</field>

            <field name="arch" type="xml">

                <form string="Add Room">

                    <sheet>

                        <group>

                            <!-- Add your fields here -->

                            <field name="room_number"/>

                            <field name="room_type"/>

                            <field name="room_price"/>

                        </group>

                    </sheet>

                </form>

            </field>

        </record>


        <!-- hotel.room action window -->

        <record id="room_action" model="ir.actions.act_window">

            <field name="name">Room</field>

            <field name="type">ir.actions.act_window</field>

            <field name="res_model">hotel.room</field>

            <field name="view_mode">tree,form</field>

            <field name="view_type">form</field>

        </record>


        <!-- This Menu Item will appear in the Upper bar, that's why It needs NO parent or action -->

        <menuitem id="hotel_menu_root" name="Hotel" sequence="100"/>

        <!-- This Menu Item Must have a parent -->

        <menuitem id="hotel_menu_categ" name="Hotel" parent="hotel_menu_root" sequence="110"/>


        <!-- This Menu Item must have a parent and an action -->

        <menuitem id="room_menu_act" name="Room" parent="hotel_menu_categ" action="room_action" sequence="170" groups="hotel.group_admin"/>

                


<!-- hotel.register tree view -->

        <record id="register_view_tree" model="ir.ui.view">

            <field name="name">hotel.register.view.tree</field>

            <field name="model">hotel.register</field>

            <field name="arch" type="xml">

                <tree>

                    <!-- Add your fields here -->

                    <field name="register_number"/>

                    <field name="check_in"/>

                    <field name="check_out"/>

                    <field name="duration"/>

                    <field name="total"/>

                </tree>

            </field>

        </record>

        

        <!-- hotel.register form view -->

        <record id="register_view_form" model="ir.ui.view">

            <field name="name">hotel.register.view.form</field>

            <field name="model">hotel.register</field>

            <field name="arch" type="xml">

                <form string="Register">

                    <sheet>

                        <group>

                            <!-- Add your fields here -->

                            <field name="register_number"/>

                            <field name="check_in"/>

                            <field name="check_out"/>

                     <field name="room_type"/>

                            <field name="duration"/>

                            <field name="total"/>

                        </group>

                    </sheet>

                </form>

            </field>

        </record>


        <!-- hotel.register action window -->

        <record id="register_action" model="ir.actions.act_window">

            <field name="name">Register</field>

            <field name="type">ir.actions.act_window</field>

            <field name="res_model">hotel.register</field>

            <field name="view_mode">tree,form</field>

            <field name="view_type">form</field>

        </record>


        <!-- This Menu Item must have a parent and an action -->

        <menuitem id="register_menu_act" name="Register" parent="hotel_menu_categ" action="register_action" sequence="130" groups="hotel.group_user_receptionist"/>


        <!-- hotel.guest tree view -->

        <record id="guest_view_tree" model="ir.ui.view">

            <field name="name">hotel.guest.view.tree</field>

            <field name="model">hotel.guest</field>

            <field name="arch" type="xml">

                <tree>

                    <!-- Add your fields here -->

                    <field name="guest_id"/>

                    <field name="guest_name"/>

                    <field name="guest_sex"/>

                </tree>

            </field>

        </record>


        <!-- hotel.guest form view -->

        <record id="guest_view_form" model="ir.ui.view">

            <field name="name">hotel.guest.view.form</field>

            <field name="model">hotel.guest</field>

            <field name="arch" type="xml">

                <form string="Guest">

                    <sheet>

                        <group>

                            <!-- Add your fields here -->

                            <field name="guest_id"/>

                            <field name="guest_name"/>

                            <field name="guest_sex"/>

                        </group>

                    </sheet>

                </form>

            </field>

        </record>

        <!-- hotel.guest action window -->

        <record id="guest_action" model="ir.actions.act_window">

            <field name="name">Guest</field>

            <field name="type">ir.actions.act_window</field>

            <field name="res_model">hotel.guest</field>

            <field name="view_mode">tree,form</field>

            <field name="view_type">form</field>

        </record>


        <!-- This Menu Item must have a parent and an action -->

        <menuitem id="guest_menu_act" name="Guest" parent="hotel_menu_categ" action="guest_action" sequence="150" groups="hotel.group_admin/>

    </data>

</odoo>


0
Avatar
Discard
Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

It seems you have given the implied_ids wrongly for the groups,


<record id="group_user_receptionist" model="res.groups">

            <field name="name">User</field>

            <field name="implied_ids" eval="[(4, ref('base.group_user'))]"/>

            <field name="category_id" ref="module_management"/>

</record>


For the group receptionist give implied_ids as base.group_user.


<record id="group_admin" model="res.groups">

            <field name="name">Admin</field>

            <field name="implied_ids" eval="[(4, ref('group_user_receptionist'))]"/>

            <field name="users" eval="[(4, ref('base.user_root'))]"/>

            <field name="category_id" ref="module_management"/>

</record>


For the admin group set the implied_ids as the receptionist group.


Please update your code as above and see whether it gives solution.


Thanks

1
Avatar
Discard
Avatar
Alvin Risman
Author Best Answer

Hi,

Sorry but the menuitem still visible for all user.

0
Avatar
Discard
Avatar
subbarao
Best Answer

I think you forgot to add read,write,create,delete permission to your group for the hotel.guest model

0
Avatar
Discard
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
Related Posts Replies Views Activity
custom module menus are hidden to all users other than admin
security menuitem rules
Avatar
Avatar
1
Sep 16
21584
User access in custom menu
security menuitem group
Avatar
0
Mar 15
3956
what is the differance between access right and record rules in odoo ? Solved
security
Avatar
Avatar
Avatar
Avatar
Avatar
5
Sep 25
15412
User Session Bug.
security
Avatar
0
Jun 25
1049
How to resolve the Access Error issue?
security
Avatar
0
Jan 25
2356
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now