[FIX] change the module of the override of name_search

This commit is contained in:
Benoit
2018-11-15 11:28:31 +01:00
parent 361176a280
commit 549328b846
3 changed files with 40 additions and 12 deletions

View File

@@ -62,18 +62,6 @@ class Partner(models.Model):
name_title = ' '.join([title, name_title])
self.name_title = name_title
@api.model
def name_search(self, name, args=None, operator='ilike', limit=100):
if args is None:
args = []
if name:
# only filter on name and ref not in email
args += [
'|', ('display_name', 'ilike', name), ('ref', 'ilike', name)]
res = super(Partner, self).name_search(
name, args=args, operator=operator, limit=limit)
return [(pid, val.replace('\n', ' ')) for pid, val in res]
class ResPartnerCategory(models.Model):
_inherit = 'res.partner.category'