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

Status: Needs review
Proposed branch: lp:~savoirfairelinux-openerp/openobject-addons/crossovered_unicode_1292245
Merge into: lp:openobject-addons/7.0
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
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+210925@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.
9901. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9902. By Christophe Simonis (OpenERP)

[FIX] calendar: correct recurrency end date computation

9903. By Olivier Dony (Odoo)

[FIX] mail.thread: avoid error if `message_unread_count` has been popped 1 line earlier

9904. By Christophe Simonis (OpenERP)

[FIX] share wizard: delete wizard lines in cascade

9905. By Olivier Dony (Odoo)

[FIX] pad: improve pad bootstrap, prevent creating useless empty pads, avoid edition warning in read-only mode for new pads, translate messages

Added a small method to detect the proper server configuration,
and make it degrade gracefully if the method is not present.
This avoids having to force a pad URL generation in order to
test the config (possibly creating useless pads).
Add a user-friendly message when the pad has not yet been
initialized for a given record, in read-only mode.

9906. By Martin Trigaux (OpenERP)

[MERGE] [FIX] stock: add some missing context, courtesy of Lionel Sausin (Numérigraphe)

9907. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9908. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9909. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

9910. By Denis Ledoux (OpenERP)

[FIX] point_of_sale: prevent duplicated order posting

9911. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

Revision history for this message
Dharti Ratani(OpenERP) (dhr-openerp) wrote :

Better to use tools.ustr() instead of unicode().

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

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

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Done

Unmerged revisions

9912. 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 2012-12-17 15:23:03 +0000
3+++ account_budget/account_budget.py 2014-03-18 13:51:07 +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@@ -116,7 +117,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'):