I have this class:
class caracteristica_fisica(osv.osv):
_name = 'caracteristica.fisica'
_columns = {
'name': fields.char('Nombre',required=True),
}
In product category, I have a many2one field making reference to caracteristica.fisica model:
class caracteristica_fisica(osv.osv):
_inherit = 'product.category'
_name = 'product.category'
_columns = {
'cf1':fields.many2one('caracteristica.fisica', 'Característica física 1')
}
Once I select this many2one cf1 field, I need this value to generate a record in comun.denominador table:
class comun_denominador(osv.osv):
_name='comun.denominador'
_columns = {
'categ_id' : fields.many2one('product.category','Categoría de Producto', select=True, ondelete='cascade'),
'cf1_cm': fields.related('categ_id', 'cf1', string="Característica física 1", type='char', store=True, select=True),
}
It generates the record in comun.denominador, but in this format:
caracteristica.fisica(4,)
and I need it to show the real name
How can I fix it?