summaryrefslogtreecommitdiff
path: root/addons/analytic
diff options
context:
space:
mode:
authorRaphael Collet <rco@odoo.com>2020-06-17 12:18:27 +0000
committerRaphael Collet <rco@odoo.com>2020-08-18 13:02:41 +0000
commit1f48130d2bd055835ee428a21922331d126285a3 (patch)
tree594a6dd2999a290712839dfe92df47d0f7ed42b1 /addons/analytic
parent89963e0eddbf36d687799acb6ed1e8486cc178e7 (diff)
[REF] core: _name_search() now returns a list of ids
This provides a better API to search for records by name without the formatting part (`display_name`). This also simplifies all the overridings of `_name_search` that no longer need to call `name_get()`. The call to `name_get()` is done in method `name_search` in a generic way.
Diffstat (limited to 'addons/analytic')
-rw-r--r--addons/analytic/models/analytic_account.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/addons/analytic/models/analytic_account.py b/addons/analytic/models/analytic_account.py
index 5c99a9dfcdf..9bbfe4a254c 100644
--- a/addons/analytic/models/analytic_account.py
+++ b/addons/analytic/models/analytic_account.py
@@ -165,8 +165,7 @@ class AccountAnalyticAccount(models.Model):
# we have to cut the search in two searches ... https://github.com/odoo/odoo/issues/25175
partner_ids = self.env['res.partner']._search([('name', operator, name)], limit=limit, access_rights_uid=name_get_uid)
domain = ['|', '|', ('code', operator, name), ('name', operator, name), ('partner_id', 'in', partner_ids)]
- analytic_account_ids = self._search(expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid)
- return models.lazy_name_get(self.browse(analytic_account_ids).with_user(name_get_uid))
+ return self._search(expression.AND([domain, args]), limit=limit, access_rights_uid=name_get_uid)
class AccountAnalyticLine(models.Model):