Fix search on country code to not search with string greater than the code
bzr revid: ced-4bce2cc48e51e6ad75f25ada35a85ce13527c722
This commit is contained in:
parent
0f66f8358f
commit
169e64cdcd
|
@ -52,10 +52,12 @@ class Country(osv.osv):
|
|||
args=[]
|
||||
if not context:
|
||||
context={}
|
||||
ids = self.search(cr, user, [('code','=',name)]+ args, limit=limit,
|
||||
context=context)
|
||||
ids = False
|
||||
if len(name) <= 2:
|
||||
ids = self.search(cr, user, [('code', '=', name)] + args,
|
||||
limit=limit, context=context)
|
||||
if not ids:
|
||||
ids = self.search(cr, user, [('name',operator,name)]+ args,
|
||||
ids = self.search(cr, user, [('name', operator, name)] + args,
|
||||
limit=limit, context=context)
|
||||
return self.name_get(cr, user, ids, context)
|
||||
_order='code'
|
||||
|
|
Loading…
Reference in New Issue