Merge lp:~savoirfairelinux-openerp/openobject-addons/crossovered_unicode_1292245-trunk into lp:openobject-addons

Status: Needs review
Proposed branch: lp:~savoirfairelinux-openerp/openobject-addons/crossovered_unicode_1292245-trunk
Merge into: lp:openobject-addons
Diff against target: 20 lines (+2/-1)
1 file modified
account_budget/account_budget.py (+2/-1)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/openobject-addons/crossovered_unicode_1292245-trunk
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+210929@code.launchpad.net

Description of the change

This fixes bug lp:1292245

Makes sure that the budget name is a unicode to avoid UnicodeEncodeError which happens when budget name contains UFT-8 characters.

To post a comment you must log in.
9213. By Sandy Carter (http://www.savoirfairelinux.com)

[FIX] Assures budget name is taken as unicode instead of str

Unmerged revisions

9213. By Sandy Carter (http://www.savoirfairelinux.com)

[FIX] Assures budget name is taken as unicode instead of str

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_budget/account_budget.py'
2--- account_budget/account_budget.py 2013-10-27 12:31:04 +0000
3+++ account_budget/account_budget.py 2014-03-18 13:55:32 +0000
4@@ -22,6 +22,7 @@
5 import datetime
6
7 from openerp.osv import fields, osv
8+from openerp.tools import ustr
9 from openerp.tools.translate import _
10
11 import openerp.addons.decimal_precision as dp
12@@ -114,7 +115,7 @@
13 for line in self.browse(cr, uid, ids, context=context):
14 acc_ids = [x.id for x in line.general_budget_id.account_ids]
15 if not acc_ids:
16- raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % str(line.general_budget_id.name))
17+ raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % ustr(line.general_budget_id.name))
18 date_to = line.date_to
19 date_from = line.date_from
20 if context.has_key('wizard_date_from'):

Subscribers

People subscribed via source and target branches

to all changes: