From f2e519b591a57fc1d4d61e80c145b10fafc00100 Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Mon, 18 Oct 2010 20:03:53 +0530 Subject: [PATCH] [FIX] account : name_search() method fixed lp bug: https://launchpad.net/bugs/613251 fixed bzr revid: ach@tinyerp.com-20101018143353-w7x03fe0s9szkyz9 --- addons/account/account.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index 5d48f122a1d..ecadfaf37f9 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -457,7 +457,9 @@ class account_account(osv.osv): 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) + #Separating code and name of account for searching + operand1,operand2 = name.split(' ',1) #name can contain spaces e.g. OpenERP S.A. + ids = self.search(cr, user, [('code', operator, operand1), ('name', operator, operand2)]+ args, limit=limit) else: ids = self.search(cr, user, args, context=context, limit=limit) return self.name_get(cr, user, ids, context=context)