Odoo Help

0

Make fields invisible in some companies

By
Maarten
on 12/16/15, 7:34 AM 503 views

I have a multicompany installation with 2 companies. Volvo and BMW for example. I would like to make a field invisible when a user is not a member of the Volvo company.

<field name="locatie_beheer_project_nummer" attrs="{'invisible': [('user.company_id.name','!=','Volvo')]}"/>

I get the following error message. 

Error: Unknown field user.company_id.name in domain [["user.company_id.name","!=","Volvo"]]

What is the correct way to do this?

Best regards,

Maarten

0
Maarten
On 12/18/15, 3:43 AM

Ok good to know you can escape the form context. 

When I do this I get the error

NameError: name 'user' is not defined

Already decided to do it with groups, seems to be the better way. Just add all Volvo users to the group. 

0

Ray Carnes

--Ray Carnes--
16818
| 9 7 9
Atlanta, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0.

Completed Odoo Functional and Technical Training.

Major Skills:

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 12/16/15, 7:35 PM

What you have written is instructing Odoo to look for a field on your form/tree view called user.

Write this:

<field name="locatie_beheer_project_nummer" attrs="{'invisible': [([user.company_id.name],"!=","Volvo")]}" />

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 12/16/15, 7:34 AM
Seen: 503 times
Last updated: 12/18/15, 3:43 AM