Spirit angel
Spirit angel

Reputation: 191

Openerp: display many2one fields within form view

there is a field many2one. when i tried to open the tree view of that field it shows empty!

here is my field:

 'classb_id': fields.many2one('class.a', 'Reception', required=True, select=True),

in my form view :

 <field name="classb_id"/>

I already create some record for class.a but tree view doesn't show any data

Upvotes: 0

Views: 2229

Answers (4)

ifixthat
ifixthat

Reputation: 6295

hello you have done 70% Of work by creating relation and creating record in relation table class.a but now in your where you created relation field classb_id open form view and that field classb_id select some record from model class.a ans save it, then you will be able to see the relation record values. Here What You did id you created all setup but last step is misssing i.e. selecting the field relational record on your relational field.

Upvotes: 1

Ruchir Shukla
Ruchir Shukla

Reputation: 805

in class.a object do you have "active" field.

if yes then make it True by default. else it will not show in the list view.

Upvotes: 0

OmaL
OmaL

Reputation: 5044

Check whether your have added two or more "classb_id" field. In openerp v6.0 when you add same field twice, only one of the field will show the data in the model and other field will show as empty.

If this doesnt solve your problem please show the model class.a, its name field, if no name field is added then its _rec_name field etc

Upvotes: 0

Avadhesh
Avadhesh

Reputation: 4703

As there is a relation with class "class.a" , 
there must be data for that object.
then and then it will show you datas in the tree view of that m2o filed.

Note: You can create a new record for class "class.a" using new button from its view

Upvotes: 0

Related Questions