Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textil
    • Kov
    • Nábytek
    • Jídlo
    • Pivovar
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • Podpora IT & hardware
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Procházet všechna odvětví
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Služby pro partnery
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
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

Odebírat

Get notified when there's activity on this post

This question has been flagged
securitymenuitem
3 Odpovědi
4192 Zobrazení
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šit
Avatar
Niyas Raphy (Walnut Software Solutions)
Nejlepší odpověď

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šit
Avatar
Alvin Risman
Autor Nejlepší odpověď

Hi,

Sorry but the menuitem still visible for all user.

0
Avatar
Zrušit
Avatar
subbarao
Nejlepší odpověď

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

0
Avatar
Zrušit
Enjoying the discussion? Don't just read, join in!

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
custom module menus are hidden to all users other than admin
security menuitem rules
Avatar
Avatar
1
zář 16
21588
User access in custom menu
security menuitem group
Avatar
0
bře 15
3958
what is the differance between access right and record rules in odoo ? Vyřešeno
security
Avatar
Avatar
Avatar
Avatar
Avatar
5
zář 25
15422
User Session Bug.
security
Avatar
0
čvn 25
1050
How to resolve the Access Error issue?
security
Avatar
0
led 25
2358
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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