Search code examples
odooodoo-11odoo-12

How to get Product name with single Attribute e.g: Product1(color)


Req is i have created a Product called Product1 and i have given 2 attributes for that i.e. color,fitting,size.

I have defined a field in sale.order

product_id = fields.Many2one('product.product', string="Product")

As per the standard we are getting Product1(color,fitting,size)

My req is i need to get only one attribute i.e. Product1(color)

I tried to do override in name_get function it is not getting. Can anyone help?

Thanks in advance


Solution

  • You need product name in sale_order product id field for that you have to override name_saerch method. In many2one field it always call name_search method. Thanx