0
votes

Here is the field information but it doesn't displayed in the web page

'type': fields.selection([('country','Country'),('state','State')],'Type'), 

In my view the field is

<field name="type"/>
1

1 Answers

0
votes

I don't quite see anything wrong with your code. There might be something else that's causing your problem. However you can try alter your code a bit: Declare the selection as a global variable outside the class:

choice = (('country','Country'),('state','State'))

Then in your class:

'type_': fields.selection(choice,string='Type'),

Your xml is ok, but you can try adding the widget="selection":

<field name="type_" widget="selection"/>

Note that I renamed your field to type_, type might be reserved.