DEV Community

Jeevachaithanyan Sivanandan
Jeevachaithanyan Sivanandan

Posted on

2

Odoo User Permission and groups

I was trying to add a new set of permission after technical in user profile page.

But I could not find the code in the odoo folder, all I have got is below

        <record id="user_groups_view" model="ir.ui.view">
            <field name="name">res.users.groups</field>
            <field name="model">res.users</field>
            <field name="inherit_id" ref="view_users_form"/>
            <field name="arch" type="xml">
                <!-- dummy, will be modified by groups -->
                <field name="groups_id" position="after"/>
            </field>
        </record>
Enter fullscreen mode Exit fullscreen mode

I was enthralled why I dont see any text for technical but later realized its autogenerated bu groups. So in order to create new permissions, we need to create our custom group-

In Odoo, to refer the groups category created by odoo, check this page
odoo\odoo\addons\base\data\ir_module_category_data.xml

example on how to add custom permission inside this category - odoo\addons\product\security\product_security.xml
<?xml version="1.0" encoding="utf-8"?>

<record id="group_product_pricelist" model="res.groups">
    <field name="name">Basic Pricelists</field>
    <field name="category_id" ref="base.module_category_hidden"/>
</record>

<record id="group_sale_pricelist" model="res.groups">
    <field name="name">Advanced Pricelists</field>
    <field name="category_id" ref="base.module_category_hidden"/>
    <field name="implied_ids" eval="[(4, ref('product.group_product_pricelist'))]"/>
</record>
Enter fullscreen mode Exit fullscreen mode

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up