hi all,
created 2 models Group and Category.
Category contains a Many2one field which point to have id column of model Group
when I am running (in developer mode) Category form view (default generated by Odoo itself), it is showing pos.group,1 pos.group,2 instead of group_name
created view part for tree and form views, but still it is showing as mentioned above.
how I can show group_name in Many2one field?
definitely I missed or did wrong something, please help resolving it.
what i did yet:
Model Group:
class PosGroup(models.Model):
_name = "pos.group"
_description = "Groups for POS"
group_name = fields.Char(string='Group Name', required=True)
Model Category:
class PosCategory(models.Model):
_name = "pos.category"
_description = "Categories for POS"
category_name = fields.Char(string='Category Name', required=True)
group_id = fields.Many2one('pos.group', string='Related Group')
also please help, if a Model contains 2 columns as Many2one relationship, how it will be done if both fields reference a single/same Model?
regards
Either you can set rec_name for the model or define the name_get function for the model.
if you are new to odoo development, see this:
Rec name: https://www.youtube.com/watch?v=d_cyPsVc7vg
Name Get: https://www.youtube.com/watch?v=-1r3WSwtqxQ