Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

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

Odoberať

Get notified when there's activity on this post

This question has been flagged
securitymenuitem
3 Replies
4202 Zobrazenia
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
Zrušiť
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
Zrušiť
Avatar
Alvin Risman
Autor Best Answer

Hi,

Sorry but the menuitem still visible for all user.

0
Avatar
Zrušiť
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
Zrušiť
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
custom module menus are hidden to all users other than admin
security menuitem rules
Avatar
Avatar
1
sep 16
21591
User access in custom menu
security menuitem group
Avatar
0
mar 15
3963
what is the differance between access right and record rules in odoo ? Solved
security
Avatar
Avatar
Avatar
Avatar
Avatar
5
sep 25
15428
User Session Bug.
security
Avatar
0
jún 25
1051
How to resolve the Access Error issue?
security
Avatar
0
jan 25
2361
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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