Skip to Content
Menu
This question has been flagged
2 Replies
7856 Views

Hey guys,

 How i create a dropdown list in form view, specifically in the a quotation view.

Thnks.

Avatar
Discard
Best Answer

Hi,

1)Inherit your model 

2)define your field like

your_field= fields.Selection([ ('type1', 'Type 1'),('type2', 'Type 2'),],'Type', default='type1')

3)add ''your_field" in inherited view

Thanks !!!  


Aswini @ iWesabe

Avatar
Discard
Best Answer

You have a couple of options. If the field contains a static list, you can define it as a Selection field. If you want to lookup the values from another model, you can define it as a Many2one field. You can then add this field to your form view.

The following link will be helpful if you are planning on coding this:

https://www.odoo.com/documentation/12.0/reference/orm.html#fields 

Avatar
Discard
Related Posts Replies Views Activity
2
Dec 23
11994
0
Oct 23
33
3
Oct 23
787
1
Oct 23
569
1
Aug 23
979