0
votes

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

4
and why should it be pre-populated for you? pls, provide more info about what are doing before, the 'context', etcsimahawk
I just think it's clear if i did't save any record before the tree view will not show any data.Indeed, I've already create my recordsSpirit angel
have you added it in your openerp.py file under 'depends' .? just put there, update module ,re-log and check itPriyan Changd

4 Answers

1
votes

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.

0
votes
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

0
votes

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

0
votes

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.