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
    • Estate 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

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
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

Hide groups from user form

Subscribe

Get notified when there's activity on this post

This question has been flagged
4 Replies
15013 Views
Avatar
Ameera PP

How to hide some groups from user form

For eg: Hiding group named 'Addresses in Sales Orders' from user form

1
Avatar
Discard
Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

You can check with "_update_user_groups_view"  function in the res_users.py (base -> res -> res_users.py ).

To hide your group,

field_name = name_boolean_group(g.id)
group_no_one = view.env.ref('base.group_no_one')
your_grp = view.env.ref('module_name.group_name')
if g == group_no_one or g == your_grp:
# make the group_no_one invisible in the form view
xml2.append(E.field(name=field_name, invisible="1", **attrs))
else:
xml2.append(E.field(name=field_name, **attrs))

This is the relevant part of the original code.


UPDATE:

In latest versions, see:https://www.youtube.com/watch?v=zbeBTImPKUw



Thanks

3
Avatar
Discard
Nikhil Krishnan

I tested it in the original code. and its work fine.

Ameera PP
Author

when the function is calling.. i think during create, write and unlink of groups. Then how it will work for existing groups

Niyas Raphy (Walnut Software Solutions)

The function will get called during the create, write and unlink of the model res.groups. IT will affect the all groups , not only newly creating group.

Paulo Matos

Hello @Niyas Raphy,

Can you please help me inherit this method and hide the group "Use products on vendor bills" from the account module?

Thank you in advance

Alberto

I saw this too, hoped there would be other way than to duplicate 100lines function just to change 2 lines.

Avatar
Badr Elboudour Zahmoul
Best Answer

you can simply create an invisible security category as following

<record model="ir.module.category" id="category_id>
<field name="name">Hidden Category</field>
<field name="visible" eval="0" />
</record> All the security groups that belongs to this category wouldn't be visible to the users
2
Avatar
Discard
Maroua ROMDHANE

doesn't work for me with odoo 13. it creates a new category named `hidden category` and the groups still appear on the user form

Avatar
Bhavin Vekariya
Best Answer

Hii,

class ResGroups(models.Model):
_inherit = 'res.groups'


def get_application_groups(self, domain):
sale_receipt_id = self.env.ref('account.group_sale_receipts').id
return super(ResGroups, self).get_application_groups(domain + [('id', '!=', sale_receipt_id)])

Thanks


0
Avatar
Discard
Willie Loo

I tried on v14 but it didn't work. Do you have a solution?

Avatar
Ayn Inc
Best Answer

 If hiding the whole category works for you,


def_get_hidden_extra_categories(self):

return ['base.module_category_hidden','base.module_category_extra','base.module_category_usability']

You can override this function in res.groups and add your group category to this function so that it will only be visible to base.group_no_one

0
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
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 ภาษาไทย 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