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

How to hide fields in OpenERP7

Subscribe

Get notified when there's activity on this post

This question has been flagged
fieldsv7customizehide
3 Replies
19163 Views
Avatar
TestUser

I read the help about field-access-rights. (My karma is insufficient to publish links)

and thought it should work - but didn't.

I want to hide the product price to a specific user group. I just want to change the visibility to this one field. I don't want to change any python code or xml file. It worked in version 6.1 and in the link above it says it should also work in version 7.

So I opened the model for product in database structure and said edit... I clicked on the price field and I was able to add a user group for this price field. I saved the field (and it worked) but I still had to save the model but that doesn't work and the field change were undone. When I do this I get an error message saying: Properties of an elementary field can't be changed that way. Please do this by adapting your python code - ideally with your own modul.

Is it or is it not possible to change just a single fields visibility to a group... with no python code or xml changes...?

3
Avatar
Discard
Avatar
Francesco OpenCode
Best Answer

To show a field in relation of a group, you can use this code:

<xpath expr="//field[@name='order_line']/tree//field[@name='tax_id']" position="replace">
    <field name="company_id" groups="your_group"/>
</xpath>
4
Avatar
Discard
TestUser
Author

Thank you too. My question is solved now.

Francesco OpenCode

Sounds Good...:)

Christophe

Where do you put this code?

Avatar
patrick
Best Answer

I do not know of a way of changing (and keeping) changes to screen fields, without modifying xml files.

It is possible to change the visibility of a field on the screen, you have to modify or create an XML-file. The advantage is also that this way you can reload the database without loosing your changes.

When a field is invisibile, it can store / keep values and/or the values will be stored in the database when saving the data. Sometimes a field is defined multiple times on a screen, so you hide one, and the other is still visible.

Example of hiding a field (in this case, hiding the taxes on sale.order.line):

  <xpath expr="//field[@name='order_line']/tree//field[@name='tax_id']" position="replace">
      <field name="tax_id" invisible="1"/>
  </xpath>

It is also possible to use attr{} so you can make it invisible depending on some things.

  <xpath expr="//field[@name='order_line']/tree//field[@name='tax_id']" position="replace">
      <field name="tax_id" attrs={'invisible':[('field name or property', '=', 'some vaue')]}/>
  </xpath>

Hope this helps you a little.

5
Avatar
Discard
TestUser
Author

Thank you very much. Is it possible to hide the field depending on a user group?

Priyesh Solanki (pso)

You can create a new group or use existing one and assign that group on the particular field like this: <field name="price" groups="NEW_GROUP_XML_ID"/>

Thanks, Priyesh Solanki

Avatar
kitcle
Best Answer

try it.  Sure!

            <field name="arch" type="xml">    
                <xpath expr="//field[@name='order_line']/tree//field[@name='price_unit']" position="inside">
                    <field name="serial_no"/>
                </xpath>
            </field>

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
Related Posts Replies Views Activity
How can we get invisible field to visible back in v15? Solved
fields customize hide undo Studio
Avatar
Avatar
Avatar
2
Aug 22
5248
How to define a field which is visible that by the one who has it to create but not the others?
fields hide
Avatar
Avatar
2
Mar 15
5721
field restriction for owner (salesperson)
fields v7
Avatar
0
Mar 15
4051
How to hide fields? Solved
fields hide
Avatar
Avatar
Avatar
3
Mar 15
30035
Show a field on specific stage (Recruiting app - 16.0 version)
fields customize phases
Avatar
Avatar
Avatar
3
Jun 23
3164
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