Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I implemented this for one of my customers who wanted to show fields in the advanced search of products according to the product category defined in context.
The advanced search widget doesn't show fields with the option selectable = False, as you can see here. Unfortunately I didn't find a way that worked to set that option for the field, and I needed it to be a dynamic option (according to some value in context in my case) anyway, so I did it by inheriting fields_get of the model, call the super method which will return a dict of fields with their options, and then add the option selectable=False to the fields I wanted to hide. For example:
def fields_get(self, cr, uid, fields=None, context=None): fields_to_hide = ['description_sale', 'reference'] # you can set this dynamically res = super(product_product, self).fields_get(cr, uid, fields, context) for field in fields_to_hide: res[field]['selectable'] = False return res
I hope it's clear.
This code works only if your OpenERP/Odoo branch revision is later than this revision
- server: firstname.lastname@example.org
- web: email@example.com
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
|Asked: 5/23/14, 5:42 AM|
|Seen: 4210 times|
|Last updated: 7/12/17, 3:03 PM|