[IMP] account: allow user to search on account.account name with copy/pasted value from name_get (like '110200 Debtors')

bzr revid: qdp-launchpad@tinyerp.com-20100903161942-reu3kq1sgiyzzfbp
This commit is contained in:
qdp-launchpad@tinyerp.com 2010-09-03 18:19:42 +02:00
parent dca67f7fd5
commit de2a55eb29
1 changed files with 2 additions and 0 deletions

View File

@ -466,6 +466,8 @@ class account_account(osv.osv):
ids = self.search(cr, user, [('shortcut', '=', name)]+ args, limit=limit)
if not ids:
ids = self.search(cr, user, [('name', operator, name)]+ args, limit=limit)
if not ids and len(name.split()) >= 2:
ids = self.search(cr, user, [('code', operator, name.split()[0]), ('name', operator, name.split()[1])]+ args, limit=limit)
else:
ids = self.search(cr, user, args, context=context, limit=limit)
return self.name_get(cr, user, ids, context=context)