Commit 9d491ed7 authored by Ivan Tyagov's avatar Ivan Tyagov

Generate search string following this format:

<existing_search_string> OPERATOR (portal_type:value1 OR portal_type:value2)

rather than as before:

<existing_search_string> portal_type:value1 OR portal_type:value2

which have a totally different meaning and generates a wrong query.
Make sure that OPERATOR is configurable (default='AND')

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@38402 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent db1e91e6
......@@ -108,7 +108,7 @@ if portal_type_list:\n
if \' \' in portal_type:\n
portal_type = \'"%s"\' %portal_type\n
portal_type_string_list.append(\'portal_type:%s\' %portal_type)\n
search_string += \' %s\' %\' OR \'.join(portal_type_string_list)\n
search_string += \' %s (%s)\' %(logical_operator, \' OR \'.join(portal_type_string_list))\n
\n
# search by reference\n
reference = kw.get(\'reference\', request.get(\'reference\', None))\n
......@@ -166,7 +166,7 @@ return search_string\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>logical_operator=\'AND\', **kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
......@@ -186,12 +186,13 @@ return search_string\n
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>logical_operator</string>
<string>kw</string>
<string>None</string>
<string>MARKER</string>
......@@ -235,7 +236,9 @@ return search_string\n
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
<tuple>
<string>AND</string>
</tuple>
</value>
</item>
<item>
......
1173
\ No newline at end of file
1175
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment