Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

Hi. I have a problem creating groups for Odoo v19

Subscribe

Get notified when there's activity on this post

This question has been flagged
securitygroupres.groups19.019
3 Replies
503 Views
Avatar
Anton

My error:

file:/c:/program%20files/odoo%2019.0.20260301/server/addons/benefits_plus/security/groups_rules.xml:4, somewhere inside
<record id="group_benefits_manage" model="res.groups">
            <field name="name">Benefits Manager</field>
            <field name="category_id" ref="base.module_category_human_resources"/>
        </record>

My code:

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data noupdate="0">
        <record id="group_benefits_manage" model="res.groups">
            <field name="name">Benefits Manager</field>
            <field name="category_id" ref="base.module_category_human_resources"/>
        </record>
    </data>
</odoo>

How to fix it? What's the problem?

0
Avatar
Discard
Codesphere Tech

Hello,
Please review the following Groups-related changes in Odoo 19.0.

<record model="res.groups.privilege" id="res_groups_privilege_employees">
<field name="name">Employees</field>
<field name="sequence">9</field>
<field name="category_id" ref="base.module_category_human_resources"/>
</record>

<record id="group_hr_user" model="res.groups">
<field name="name">Officer: Manage all employees</field>
<field name="sequence">10</field>
<field name="privilege_id" ref="res_groups_privilege_employees"/>
<field name="implied_ids" eval="[(6, 0, [ref('base.group_user')])]"/>
<field name="comment">The user will be able to create and edit employees.</field>
</record>

Anton
Author

Sorry but that's not it! How to check the uniqueness of an identifier? In Settings - Technical - external ID there is no such identifier at all. Changing to any other name has no effect. My __manifest__.py :
"depends": [
"account",
"base",
'mail',
'hr',
"purchase"
],
"data": [
"security/groups_rules.xml",
"views/res_users_views.xml"

File res_users_views.xml:
<record id="view_users_form_inherit_benefits" model="ir.ui.view">
<field name="name">res.users.form.inherit.benefits</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form"/>>
<field name="arch" type="xml">
<!-- На вашем скрине страница называется access_rights, а внутри группа Roles -->
<xpath expr="//page[@name='access_rights']/group[1]" position="after">
<group string="Дополнительные права (Benefits)">
<field name="has_group_benefits"/>>
</group>
</xpath>
</field>
</record>
My python code:
from odoo import models, fields, api

class ResUsers(models.Model):
_inherit = 'res.users'

has_group_benefits = fields.Boolean(
string="Benefits Access",
compute="_compute_has_group_benefits",
inverse="_inverse_has_group_benefits"
)

def _compute_has_group_benefits(self):
group = self.env.ref('benefits_plus.group_benefits_manage')
if not group:
return
for user in self:
user.has_group_benefits = group in user.groups_id

def _inverse_has_group_benefits(self):
group = self.env.ref('benefits_plus.group_benefits_manage')
if not group:
return
for user in self:
if user.has_group_benefits:
user.groups_id = [(4, group.id)]
else:
user.groups_id = [(3, group.id)]

Perhaps this will help to better understand the situation:

Avatar
Anton
Author Best Answer

My manifiest

"depends": [
"base",
'hr',
"account",
'mail',
"purchase"
],
"data": [
"security/groups_rules.xml",
"security/ir.model.access.csv",

Dont word

<record id="group_benefits_plus_manage1" model="res.groups">
<field name="name">Benefits Manager</field>
<field name="category_id" ref="base.module_category_human_resources"/>
</record>
0
Avatar
Discard
Avatar
Sujata
Best Answer

Hi Anton, 

From your code, the definition looks correct to me. Can you double-check these 2 things?

1. Make sure base is added to your module's manifest:

'depends': ['base', 'hr'],  # 'base' must be here

2. If that's already there, try changing the record id to something more unique:

<record id="group_benefits_plus_manage" model="res.groups">
    <field name="name">Benefits Manager</field>
    <field name="category_id" ref="base.module_category_human_resources"/>
</record>

A duplicate id conflict with another module could be causing the issue.

0
Avatar
Discard
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Best Answer
Hi,

The problem is most likely caused by a duplicate external ID in Odoo. The record ID group_benefits_manage may already exist in the database or in another module, and Odoo does not allow two records with the same external ID. Even though your XML syntax is correct, the conflict happens during module installation or upgrade when Odoo tries to create a group with an ID that already exists. To fix this, change the record ID to something unique, preferably by adding your module name as a prefix, such as benefits_plus_group_manager. Also ensure that the required dependency is present in the __manifest__.py file because you are referencing base.module_category_human_resources, which comes from the HR module. So your manifest should include base and hr in the depends section. After making these changes, restart Odoo and upgrade the module so the corrected XML is loaded properly.

Hope it helps

-1
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
Keep Getting "The user cannot have more than one user types." Solved
security users group
Avatar
1
Nov 21
7220
Struggling with ir.model.access.csv Solved
security group access
Avatar
Avatar
Avatar
2
Sep 21
13503
How to create user Group Application for your module? Solved
security xml group
Avatar
Avatar
6
Jan 21
46668
How to show Groups in user from ONLY for Admin?
security group groups
Avatar
0
Jun 20
4456
how to hide 'res.groups' entries from user's page?
security groups res.groups
Avatar
0
Oct 15
7194
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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