From a7bac68f45c80eb6a02af9128ecbec67806b74a8 Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Mon, 18 Jan 2016 10:16:45 +0100 Subject: [PATCH] [FIX] base: location_name_search search may return twice the limit value --- openerp/addons/base/res/res_country.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/res/res_country.py b/openerp/addons/base/res/res_country.py index e59d00ed50a..c7c4adaa0ab 100644 --- a/openerp/addons/base/res/res_country.py +++ b/openerp/addons/base/res/res_country.py @@ -19,7 +19,7 @@ def location_name_search(self, cr, user, name='', args=None, operator='ilike', if ids: search_domain.append(('id', 'not in', ids)) ids.extend(self.search(cr, user, search_domain + args, - limit=limit, context=context)) + limit=limit-len(ids), context=context)) locations = self.name_get(cr, user, ids, context) return sorted(locations, key=lambda (id, name): ids.index(id))