Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

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

Subscriure's

Get notified when there's activity on this post

This question has been flagged
securitymenuitem
3 Respostes
4194 Vistes
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
Descartar
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
Descartar
Avatar
Alvin Risman
Autor Best Answer

Hi,

Sorry but the menuitem still visible for all user.

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
custom module menus are hidden to all users other than admin
security menuitem rules
Avatar
Avatar
1
de set. 16
21588
User access in custom menu
security menuitem group
Avatar
0
de març 15
3958
what is the differance between access right and record rules in odoo ? Solved
security
Avatar
Avatar
Avatar
Avatar
Avatar
5
de set. 25
15422
User Session Bug.
security
Avatar
0
de juny 25
1050
How to resolve the Access Error issue?
security
Avatar
0
de gen. 25
2359
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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