← Back to team overview

openerp-india team mailing list archive

[Bug 1292245] Re: account_budget has UnicodeEncodeError when raising except_osv

 

** Also affects: ocb-addons/7.0
   Importance: Undecided
       Status: New

** Changed in: ocb-addons/7.0
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/1292245

Title:
  account_budget has UnicodeEncodeError when raising except_osv

Status in OpenERP Community Backports (Addons):
  Fix Committed
Status in OpenERP Community Backports (Addons) 7.0 series:
  Fix Committed
Status in OpenERP Addons (modules):
  New

Bug description:
  Invoice budget's warning when crossovered budget lines are not related
  to any account will cause a UnicodeEncodeError if the account has
  unicode-only characters such as é.

  How to reproduce:
  * Fresh database, install account_budget without demo.
  * Under menu (Invoicing|Budgets|Budgets)
  ** Create a new budget, name it what you want, add the dates and code you want.
  ** Add a budget line, choose whatever dates you want and add a new budgetary position by clicking Create and Edit.
  *** In the Budgetary Position form, put whatever code you want, but Give it a name with a utf character such as "Testé".
  *** Do not add an account to the budgetary position.
  *** Save the budgetary position
  ** Save and close the budgetary line
  * Save the Budget form

  Expected output:
  OpenERP outputs a Warning (except_osv) which reads:
  Error!

  The Budget 'Testé' has no accounts!

  Actual output:
  OpenERP outputs an error message with the following output

  Server Traceback (most recent call last):
    File "web/addons/web/session.py", line 89, in send
      return openerp.netsvc.dispatch_rpc(service_name, method, args)
    File "openerp/netsvc.py", line 358, in dispatch_rpc
      result = ExportService.getService(service_name).dispatch(method, params)
    File "openerp/service/web_services.py", line 626, in dispatch
      res = fn(db, uid, *params)
    File "openerp/osv/osv.py", line 190, in execute_kw
      return self.execute(db, uid, obj, method, *args, **kw or {})
    File "openerp/osv/osv.py", line 132, in wrapper
      return f(self, dbname, *args, **kwargs)
    File "openerp/osv/osv.py", line 199, in execute
      res = self.execute_cr(cr, uid, obj, method, *args, **kw)
    File "openerp/osv/osv.py", line 187, in execute_cr
      return getattr(object, method)(cr, uid, *args, **kw)
    File "server/openerp/osv/orm.py", line 3674, in read
      result = self._read_flat(cr, user, select, fields, context, load)
    File "openerp/osv/orm.py", line 3795, in _read_flat
      res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)
    File "openerp/osv/fields.py", line 1142, in get
      result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
    File "account_budget/account_budget.py", line 139, in _prac
      res[line.id] = self._prac_amt(cr, uid, [line.id], context=context)[line.id]
    File "account_budget/account_budget.py", line 119, in _prac_amt
      raise osv.except_osv(_('Error!'),_("The Budget '%s' has no accounts!") % str(line.general_budget_id.name))
  UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 4: ordinal not in range(128)

  Version 7.0
  addons: r9900
  server: r5259
  web: 4159

To manage notifications about this bug go to:
https://bugs.launchpad.net/ocb-addons/+bug/1292245/+subscriptions


References