Odoo Help


Explanation about widget="selection" [Closed]

on 4/17/13, 6:44 AM 7,930 views

The Question has been closed

Sudhir Arya (ERP Harbor Consulting Services)
on 04/18/2013 05:08:34

I need to know what is the actual scenario with widget option in OpenERP 7. is it works as readonly field when we use it in form views ?

i used it in my one of form.when i save records in form, that widget values are not saved.

<field name="job_position" placeholder="Finance Manager" widget="selection" />

Sudhir Arya (ERP Harbor Consulting Services)

--Sudhir Arya (ERP Harbor Consulting Services)--
| 6 8 8
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• 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

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 




Sudhir Arya
ERP Harbor Consulting Services
Sudhir Arya (ERP Harbor Consulting Services)
On 4/17/13, 7:03 AM

widget="selection" is used with many2one field. That field become selection field & user cannot change its value.

When you open many2one field without widget, you can see tree,form view but with widget there is no tree,form view. It will be selection only.

ok Arya thanks..I got it thatswhy its not shows in my Tree view .? but when i checked in my tables also its not saved

on 4/17/13, 7:08 AM

Priyesh Solanki (pso)

--Priyesh Solanki (pso)--

| 2 2 4
--Priyesh Solanki (pso)--
Priyesh Solanki (pso)
On 4/17/13, 7:24 AM

widget="selection" means it will show all the records of position(many2one) in the selection box. It means if you do not want any user to edit/modify it's record, widget="selection" is useful.

Regarding your issue, issue is due to placeholder attribute, that you used. Place holder will display that value in selection box which may not store in your many2one table and that's why while saving the record, value disappears. Try by removing placeholder over there. If you want any value by default in selection , use _defaults attribute in class.

Thanks, Priyesh Solanki

thanks Priyesh..its really helpful tip :-)

on 4/17/13, 7:42 AM

In openerp 7 many2one search field default shows 8 record. How to increase the default value size to 20? (in the selection widget shows all record with out search condition) is any other way to increase search record

on 9/6/13, 7:03 AM

Francesco OpenCode

--Francesco OpenCode--

| 6 8 9
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode
On 4/17/13, 7:08 AM

When you set a many2one field with the tag selection, it become a selection with dymamic values get from many2one relative table. This is usefull if you wantshow values that user can't modify. The selection widget tag is used only with many2one.

yeah..it means we cannot use it in form view to save records by that widget ?

on 4/17/13, 7:18 AM

Yes, you can use it like a normal selection. The only difference between m2o and m2o with selection is that the frist one is editable and searchble, the second one no.

Francesco OpenCode
on 4/17/13, 7:20 AM

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

Question tools

1 follower(s)


Asked: 4/17/13, 6:44 AM
Seen: 7930 times
Last updated: 3/16/15, 8:10 AM