From 73fb756f3e92442a40c67e7bb85bc0fea1685632 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 10 Nov 2009 23:59:05 +0100 Subject: [PATCH 1/2] Use the same operator when searching for code in search_rec_name for issue1266 --- party.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/party.py b/party.py index 217f7ae9d7..634fae04ec 100644 --- a/party.py +++ b/party.py @@ -169,7 +169,7 @@ class Party(ModelSQL, ModelView): args2 = [] i = 0 while i < len(args): - ids = self.search(cursor, user, [('code', '=', args[i][2])], + ids = self.search(cursor, user, [('code', args[i][1], args[i][2])], context=context) if ids: args2.append(('id', 'in', ids)) From 3fa3be1fe2b502a41266fc20f74f8dc9bdfe26a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 11 Nov 2009 00:02:57 +0100 Subject: [PATCH 2/2] Append parties with name matching to the parties with code matching --- party.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/party.py b/party.py index 634fae04ec..4621a361f5 100644 --- a/party.py +++ b/party.py @@ -172,6 +172,8 @@ class Party(ModelSQL, ModelView): ids = self.search(cursor, user, [('code', args[i][1], args[i][2])], context=context) if ids: + ids += self.search(cursor, user, + [('name', args[i][1], args[i][2])], context=context) args2.append(('id', 'in', ids)) else: args2.append(('name', args[i][1], args[i][2]))