Hello everybody!!
May any one help me know please how to override the function _name_search of product.product.
I have tried this but not working.
I have a field in product.product called REF and i want to search on it.
Thanks a lot in advance.
@api.model
def _name_search(self, name, args=None, operator='ilike', limit=100, name_get_uid=None):
args = args or []
recs = self.browse()
if name:
recs = self.search([('ref', '=like', name)] + args, limit=limit)
if not recs:
recs = self.search([('name', operator, name)] + args, limit=limit)
return recs.name_get()
how to use name_search: http://learnopenerp.blogspot.com/2017/03/how-to-search-many2one-field-by-other.html