Odoo Help


5 الإجابات
Aleksander Nøkland النرويج
15‏/2‏/2017 9:38 ص

In Odoo10 you can do the following:

<field name="myfield" attrs="{'invisible': [('product_id','!=', %(other_module.xml_id)d)]}"/>

Source: https://answers.launchpad.net/openobject-server/+question/181987

1 تعليق
Norges Eiendomsfinans AS, Aleksander Nøkland النرويج
15‏/2‏/2017 9:40 ص

Whoops. Didn't read the entire question.

You can still use this for xml-id's in attrs at least...

الصورة الرمزية

Sudhir Arya (ERP Harbor Consulting Services) الهند

--Sudhir Arya (ERP Harbor Consulting Services)--
| 8 9 10
Ahmedabad, الهند
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & CTO at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert having 7+ years of Experience in Odoo ERP.

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Good knowledge and experience in payment gateway integration with Odoo

• Active Memeber on Stackoverflow 




ERP Harbor Consulting Services

Website: http://www.erpharbor.com
Sudhir Arya (ERP Harbor Consulting Services) الهند
15‏/2‏/2017 2:09 م

Hi Valentine,

By overriding fields_view_get you can do so.

Reference: fields_view_get example

الصورة الرمزية

Marvin Taboada بوليفيا

--Marvin Taboada--

| 4 3 8
Cochabamba, بوليفيا
--Marvin Taboada--
Marvin Taboada بوليفيا
9‏/9‏/2015 11:48 م

Sorry valentin, you can't do this.

`ref()` can only be used inside `eval` XML attributes (which is evaluated by Odoo's `safe_eval` module) as in the following example:


If your product is well known (you're already referring it by their External-ID in your example), you may try referring other field with a known value, like the product `code` ("Internal Reference") or  `ean13` ("EAN13 Barcode"):

<field name="myfield" attrs="{'invisible': [('product_id.code', '!=', 'SOME.PRODUCT.CODE')]}"/>


الصورة الرمزية

Tarek Mohamed Ibrahim مصر

--Tarek Mohamed Ibrahim--
| 5 4 9
Gîza, مصر
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.



Tarek Mohamed Ibrahim مصر
9‏/9‏/2015 2:54 م

I think you can't hide columns in tree view depending on some choices in the runtime. This is straightforward in form views and could be achieved using attrs tag.

اطرح سؤالاً
Keep Informed
0 متابعين
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.

Odoo Training Center

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

Test it now