Odoo Help


Problem with selection field

Praveen S
on 7/4/13, 5:49 AM 2,591 views

Hi, i am new to openerp. when i am trying to add a selection field in my module,it will not generate any error but the selection drop-down is not displaying.But the label Type and separator are displayed.

My files are here


import region


    'name': 'Region information',
    'version': '2.0',
    'author': 'Praveen',
    'depends': ['base'],
    'data': [  # data files to load at module install
    'demo': [],  # demo data (for unit tests)


from openerp.osv import osv, fields

class region(osv.Model):
    _name = 'region.region'
    _columns = {
       'name': fields.char('Name', size = 100), 
    'type': fields.selection([('country','Country'),('state','State')],'Type'),  


<?xml version="1.0" encoding="utf-8"?>
        <menuitem id="region_main_menu" name="Regions"/>

     <record id="region_region_tree_view" model="ir.ui.view">
        <field name="name">region.region.tree</field>
        <field name="model">region.region</field>
        <field name="arch" type="xml">
            <tree string="Regions">
                <field name="name"/>
                <field name="type"/>

    <record id="region_region_form_view" model="ir.ui.view">
        <field name="name">region.region.form</field>
        <field name="model">region.region</field>
        <field name="arch" type="xml">
            <form string="regions" version="7.0">
                <group col="4" colspan="4">
                    <field name="name"/>
                    <field name="type"/>

    <record id="region_normal_action" model="ir.actions.act_window">
        <field name="name">region</field>
        <field name="res_model">region.region</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>

    <menuitem id="section_main_menu" parent="region_main_menu" name = "Region Information"/>
    <menuitem id="region_real_menu" parent="section_main_menu" action="region_normal_action"/>


Ghanshyam Prajapati

--Ghanshyam Prajapati--

| 4 4 8
Pune, India
--Ghanshyam Prajapati--
OpenERP Developer
Ghanshyam Prajapati
On 7/4/13, 6:50 AM

Hi, i have installed your module, it works perfectly,

Try to update your module through following,

./openerp-server --addons-path=../addons/,../openerp-web/addons/ -d your_db_name -u your_module_name

i cant get it .how to update like this .Pls give me a detailed description and kindly give the files that worked perfectly in your system.

Praveen S
on 7/4/13, 6:58 AM

Your code is ok, just update your module. If you are using ubuntu operating system then, go to terminal >> paste above line, here ../addons/,../openerp-web/addons/ is your addons path. second way Go to Settings >> Modules >> Installed Modules. Now search your module and update it.

Ghanshyam Prajapati
on 7/4/13, 7:02 AM

i am using windows 8 how to do this in windows 8

Praveen S
on 7/4/13, 7:19 AM

Go to Settings >> Modules >> Installed Modules. Now remove installed from search and type name of your module and search it, after searching click on your module and upgrade it.

Ghanshyam Prajapati
on 7/4/13, 7:24 AM

i do this but the same will happens .Not displaying the selection drop-down but its label "type" was displayed

Praveen S
on 7/4/13, 7:28 AM

Will you pls give the files that successfully worked in your system

Praveen S
on 7/4/13, 7:36 AM

hello Ghanshyam Prajapati
Will you pls give the files that successfully worked in your system

Praveen S
on 7/4/13, 7:50 AM

Do you remember i gave you link of my module(Previous Question), Is it worked for you??

Ghanshyam Prajapati
on 7/4/13, 7:54 AM

yes that code worked for me but my module doesn't worked when we made such changes

Praveen S
on 7/4/13, 9:11 AM

https://www.dropbox.com/s/1n2kx2cvpp3bpyr/test_module_new.zip download my module. and please mark my both answer as solved if it worked for you. Thanks

Ghanshyam Prajapati
on 7/4/13, 9:41 AM

thanks Ghanshyam Prajapati your code works perfetly. But i didn't solve it my code. Are you know anything about my coding problem? If you know please help me....

Praveen S
on 7/5/13, 3:57 AM

Grover Menacho

--Grover Menacho--
| 5 7 8
La Paz, Bolivia
--Grover Menacho--

Odoo Developer

Grover Menacho
On 7/4/13, 2:29 PM


Delete your fields.selection and insert this:

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

It should work.

thanks Grover for your replay, but its not working.

Praveen S
on 7/5/13, 4:03 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: 7/4/13, 5:49 AM
Seen: 2591 times
Last updated: 3/16/15, 8:10 AM