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

Proposed by Yann Papouin
Status: Rejected
Rejected by: Stefan Rijnhart (Opener)
Proposed branch: lp:~yann-papouin/ocb-server/7.0-bug-1049653-translatable-unaccent
Merge into: lp:ocb-server
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/7.0-bug-1049653-translatable-unaccent
Reviewer Review Type Date Requested Status
Raphaël Valyi - http://www.akretion.com Needs Information
Pedro Manuel Baeza code review Approve
Holger Brunn (Therp) code review Approve
Review via email: mp+210165@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

mutatis mutandis the same as ocb-6.1

review: Approve (code review)
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Thanks for the patch.

Regards.

review: Approve (code review)
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Hello,

somebody to compare with existing MP from Cloves Almeida and take the best one?
https://code.launchpad.net/~cmsa/openobject-server/openobject-server-7.0-fix-unaccent/+merge/197810

review: Needs Information
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

I mean Carlos Almeida sorry.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Raphaël,

As far as I can see, Carlos Almeida patch is incomplete, because it doesn't take in account certain values that can be unaccented too.

Indeed, this solution applies unaccent indiscriminately (even to the left part of the comparison), but I think it's done in this way to follow official patch.

Regards.

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Setting to 'rejected' because an alternative fix was merged here: http://bazaar.launchpad.net/~openerp/openobject-server/7.0/revision/5268. Nevertheless, thanks for the proposal!

Unmerged revisions

5284. By Damián Soriano (damiansoriano)

[FIX] --unaccent parameter does not work

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 2014-02-06 08:47:08 +0000
3+++ openerp/osv/expression.py 2014-03-10 10:02:31 +0000
4@@ -1046,11 +1046,18 @@
5 ' FROM "' + working_model._table + '"' \
6 ' WHERE "' + left + '" ' + sql_operator + ' ' + " (" + instr + "))"
7 else:
8- subselect += ' AND value ' + sql_operator + instr + \
9- ') UNION (' \
10- ' SELECT id' \
11- ' FROM "' + working_model._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_model._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_model._table + '"' \
24+ ' WHERE "' + left + '" ' + sql_operator + instr + ")"
25
26 params = [working_model._name + ',' + left,
27 context.get('lang', False) or 'en_US',

Subscribers

People subscribed via source and target branches

to status/vote changes: