hi.
i just created a table/model named "logistic.charge" for storing three values with field say: from ,to, fare. Then from the form i succesfully saved the three values.
then i created a table/model named "logistic.logistic" with same field mentioned above here many2one is used for picking the value from logistic.charge . this will installed succesfully. Here is the py file
from openerp.osv import fields, osv
class logistic_detail(osv.osv):
_name = "logistic.logistic"
_description = "Logistic charges"
_columns = {
'from': fields.many2one('logistic.charge','from','from'),
'to': fields.many2one('logistic.charge','to','to'),
'fare': fields.many2one('logistic.charge','fare','fare'),
}
logistic_detail()
But in the form view there have three fields. from , to , inorder to click the arrow in the field . it will not display the content of the corresponding coloum in the table logistic.charge this will display the name of the table and an id here is the image
is there any error in programming. in place i put res.partner this will gives output by listing the partners in the table.
I think in object "logistic.charge" does not have field "name". You try to add field "name" for this object or use _rec_name = "field_a" ("field_a" is a field which you want to view value in many2one field).
I've already told you. You have to add _rec_name in 'logistic.charge' class. res.partner displays the name because that class has a 'name' field. If you don't have a name field you have to add _rec_name property.