Creating New Groups in Odoo

Black and White picture Black and White · Oct 5, 2015 · Viewed 15.7k times · Source

I have created a new Groups which is a Personnel Group, But in the View Metadata the new Group I've created has no XML ID, where can I find the XML ID or add the XML ID of the new groups even in the external ID menu I cannot find the ID.

Answer

Jainik Patel picture Jainik Patel · Oct 5, 2015

enter image description here

How to create or edit custom groups:

  • open Settings->Users->Groups
  • select some group "Custom User Groups / ..." or create new one and set value "Custom User Groups" for "Application" field
  • click "edit"
  • add or delete inherited groups in "Inherited" tab
  • click "save"

How to apply groups for some users:

  • open Settings->Users->Users
  • select user you need
  • click "clear access rights"
  • tick access groups you need. In the main, you have to use only ones from "Custom User Groups" sector, because all inherited tick boxes will be ticked automatically, after you click save.
  • click save

Please note, that if you delete some technical group from custom group, then you have to repeat process of applying groups for each related users. If you don't repeat applying process then removed group would be kept in related users, because there is no way to figure out is it was added by inheritance or manually as a extra access to that user.

I managed to do it with a few hours of searching in the XMLs:

This is a Example of Security Group Create

security/ng_office_technology_security:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="0">
    <record id="office_technology_group" model="res.groups">
        <field name="name">Office technology</field>
        <field name="comment">Office Technology Permission Group.</field>
        <field name="category_id" ref="ng_office_technology.module_category_ng_office_technology"/>
    </record>
    <record model="ir.module.category" id="module_category_ng_office_technology">
            <field name="name">Office Technology</field>
            <field name="description">The Office technology Applilcation</field>
            <field name="sequence">20</field>
    </record>
</data>
</openerp>