Merge lp:~yann-papouin/ocb-server/6.1-bug-1049653-translatable-unaccent into lp:ocb-server/6.1

Proposed by Yann Papouin
Status: Merged
Approved by: Yannick Vaucher @ Camptocamp
Approved revision: 4325
Merged at revision: 4327
Proposed branch: lp:~yann-papouin/ocb-server/6.1-bug-1049653-translatable-unaccent
Merge into: lp:ocb-server/6.1
Diff against target: 27 lines (+12/-5)
1 file modified
openerp/osv/expression.py (+12/-5)
To merge this branch: bzr merge lp:~yann-papouin/ocb-server/6.1-bug-1049653-translatable-unaccent
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) code review Approve
Pedro Manuel Baeza Approve
Review via email: mp+204252@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Same as official one!

If the bug is still present on 7.0/trunk, can you make also an MP for it?

Regards.

review: Approve
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

looks like indeed this never made it into trunk, so an MP for ocb-7.0 would be great

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openerp/osv/expression.py'
2--- openerp/osv/expression.py 2012-01-24 12:42:52 +0000
3+++ openerp/osv/expression.py 2014-01-31 14:58:05 +0000
4@@ -637,11 +637,18 @@
5 ' FROM "' + working_table._table + '"' \
6 ' WHERE "' + left + '" ' + sql_operator + ' ' +" (" + instr + "))"
7 else:
8- subselect += ' AND value ' + sql_operator + instr + \
9- ') UNION (' \
10- ' SELECT id' \
11- ' FROM "' + working_table._table + '"' \
12- ' WHERE "' + left + '" ' + sql_operator + instr + ")"
13+ if self.has_unaccent and sql_operator in ('ilike', 'not ilike'):
14+ subselect += ' AND unaccent(value) ' + sql_operator + ' unaccent(' + instr + \
15+ ')) UNION (' \
16+ ' SELECT id' \
17+ ' FROM "' + working_table._table + '"' \
18+ ' WHERE unaccent("' + left + '") ' + sql_operator + ' unaccent(' + instr + '))'
19+ else:
20+ subselect += ' AND value ' + sql_operator + instr + \
21+ ') UNION (' \
22+ ' SELECT id' \
23+ ' FROM "' + working_table._table + '"' \
24+ ' WHERE "' + left + '" ' + sql_operator + instr + ")"
25
26 params = [working_table._name + ',' + left,
27 context.get('lang', False) or 'en_US',

Subscribers

People subscribed via source and target branches

to status/vote changes: