DEV Community

Jeevachaithanyan Sivanandan
Jeevachaithanyan Sivanandan

Posted on

1

how to create new permission groups, permission category

How to update and control permissions of an app and/or menu items using xml

  1. first of all we need to override - ir_module_category_data.xml
  2. locate the menu items we need to hide/show based on permissions
  3. create the new permissions grroups, if it requires, under new category

full code below


<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <record model="ir.module.category" id="category_custompermission">
            <field name="name">The E-Cig Store Permissions</field>
            <field name="sequence">70</field>
            <field name="visible" eval="1" />
        </record>

        <record id="group_ecig_view_contacts_app" model="res.groups">
            <field name="name">View Contacts App</field>
            <field name="category_id" ref="custom_module_name.category_custompermission"/>
        </record>
        <record id="group_ecig_view_employees_app" model="res.groups">
            <field name="name">View Employees App</field>
            <field name="category_id" ref="custom_module_name.category_custompermission"/>
        </record>
        <record id="group_ecig_view_pos_app" model="res.groups">
            <field name="name">View POS Ribbon</field>
            <field name="category_id" ref="custom_module_name.category_custompermission"/>
        </record>

        <record id="contacts.menu_contacts" model="ir.ui.menu">
            <field name="groups_id" eval="[(5,0),(4, ref('custom_module_name.group_ecig_view_contacts_app'))]"/>
        </record>

        <record id="hr.menu_hr_root" model="ir.ui.menu">
            <field name="groups_id" eval="[(5,0),(4, ref('custom_module_name.group_ecig_view_employees_app'))]"/>
        </record>

        <record id="point_of_sale.pos_config_menu_catalog" model="ir.ui.menu">
            <field name="groups_id" eval="[(5,0),(4, ref('custom_module_name.group_ecig_view_pos_app'))]"/>
        </record>
        <record id="point_of_sale.menu_point_of_sale" model="ir.ui.menu">
            <field name="groups_id" eval="[(5,0),(4, ref('custom_module_name.group_ecig_view_pos_app'))]"/>
        </record>




    </data>
</odoo>
Enter fullscreen mode Exit fullscreen mode

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more