Merge lp:~openerp-dev/openobject-addons/trunk-bug-944761-amp into lp:openobject-addons

Proposed by Amit Parik
Status: Merged
Merged at revision: 6950
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-944761-amp
Merge into: lp:openobject-addons
Diff against target: 11 lines (+1/-1)
1 file modified
project_gtd/project_gtd.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-944761-amp
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Approve
Amit Parik (community) Needs Resubmitting
Review via email: mp+100272@code.launchpad.net

Description of the change

Fixes the unicode problem on my task view which is created from fields_view_get

This view doesn't open in other languages (i.e French,Italian ) without demo data.

This fix will solved this problem.

Thanks!

To post a comment you must log in.
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

FYI, the fix was applied in 6.1 at revision 6767. But I don't think it was a good idea to hardcode unicode('utf-8').
The safer way to accomplish this is to use tools.ustr() which will behave properly in case the parameter is already unicode. It could happen if someone else inherits fields_view_get and converts res['arch'] to unicode upstream, for instance. This is our standard technique to coerce anything to unicode.

Thanks!

review: Needs Fixing
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Olivier,

I have used the tools.ustr()instead of unicode utf-8 directly as you suggested, So please check it again!

Thanks for the suggestion!

review: Needs Resubmitting
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Looks ok to me now

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'project_gtd/project_gtd.py'
2--- project_gtd/project_gtd.py 2011-12-21 22:15:04 +0000
3+++ project_gtd/project_gtd.py 2012-05-02 13:38:24 +0000
4@@ -115,7 +115,7 @@
5 search_extended += '''<filter domain="[('timebox_id','=', ''' + str(time.id) + ''')]" icon="''' + icon + '''" string="''' + time.name + '''" context="{'user_invisible': True}"/>\n'''
6 search_extended +='''<separator orientation="vertical"/>'''
7
8- res['arch'] = res['arch'].replace('<separator name="gtdsep"/>', search_extended)
9+ res['arch'] = tools.ustr(res['arch']).replace('<separator name="gtdsep"/>', search_extended)
10
11 return res
12

Subscribers

People subscribed via source and target branches

to all changes: