Community mailing list archives
Re: Many2One in Odoo v9 communityby
You need to set your _rec_name, choose a column to act as name if you don't have that field on the comodel.
_name = 'comodel.object'
_rec_name = 'column_name'
Other option to create complex names is name_get
Grover Menacho Q.GH Mediacloud
De: Kristian Koci <email@example.com>
Enviado: jueves, 06 de octubre de 2016 09:58 a.m.
Asunto: Many2One in Odoo v9 communityThanks in advance!How can I fix this to actually show the Char field content?So, I have this model:I just want to know how to show a Char field as a Many2one in v9, since it has changed a little.Hi, I'm on Odoo v9 community
_name = 'mymodel'
field_ = fields.Char(string="This is a field")
And then I load this into, let's say account.invoice model:
If I do this, the relation is there, and it shows the field, BUT; it is not showing the actual content of the field, just and id like: mymodel,1
_inherit = "account.invoice"
relation = fields.Many2one(comodel_name="
mymodel", string="That other field")