Reputation: 1615
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" />
Upvotes: 1
Views: 1159
Reputation: 707
With widget, one can change the look of the field. In OpenERP, one can use such kind of many widget like widget="selection"/"statusbar"/"monetory"/"progressbar"/"html"/"email"/"image", etc. but it does not work as readonly field.
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.
Upvotes: 2