already reconcilled entry cause unhandled exception

Bug #314292 reported by Xavier ALT
2
Affects Status Importance Assigned to Milestone
Odoo Server (MOVED TO GITHUB)
Fix Released
High
Unassigned

Bug Description

Server raise the following error when clicking "confirm" on Financial Statement.

/home/dex/w/dex3/addons/account/account_move_line.py:496: DeprecationWarning: raising a string exception is deprecated
  raise _('Already Reconciled')
Exception in thread Thread-284:
Traceback (most recent call last):
  File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
    self.run()
  File "/home/dex/Work/dex3/server/bin/netsvc.py", line 356, in run
    new_e = Exception(tools.ustr(e.exception)) # avoid problems of pickeling
  File "/home/dex/Work/dex3/server/bin/tools/misc.py", line 679, in ustr
    value = str(value)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 48:

Versions:
oo-server: (trunk) r1565
oo-client: (trunk) r865
oo-addons: (trunk) r2067

Steps to reproduce the error:
- Create a new DB (with demo data)
- Choose "Accounting only profile"
- Configure the base, use default params
  (note: I choose `Luxembourg' chart of account)

- Go to: Financial Management > Entries Encoding > Entries by Statements > New Statement
  - Choose Journal: x Bank Journal
  - Clic Import Invoice, clic Customer Invoice, clic Add (this add an entry with field Move = Test invoice 1), clic Ok
  - Clic Compute, and fill Ending balance
  - Clic Confirm
  (note: now this entry is reconcilled)

- Go to: Financial Management > Entries Encoding > Entries by Statements > New Statement
  - Choose Journal: x Bank Journal
  - Add a new entry to one2many field "Statement lines"
    - in field Name, enter: débug
    - in field Partner, choose Agrolait
    - in field Amount, enter: 50,00
    - in field Reconcile, choose: [1850,00] (autocompleted as they're only one entry)
  - Clic compute, and fill Ending balance
  - And finally, clic confirm

Note: if we change the Name field, with something ascii complient (ex: debug), the behaviour is correct (i.e.: We get and exception box which say that we can't reconcille the entry)

Revision history for this message
Xavier ALT (dex-phx) wrote :

Here is another patch, completing the commit 2669 from Stéphane.

in netsvc.py, line 356, we have:
new_e = Exception(tools.ustr(e.exception)) # avoid problems of pickeling

this cause problem because e.exception have type Exception, so ustr do a str() on it, which break if the exception string is / contrain unicode.

Changed in openobject-server:
importance: Undecided → High
Revision history for this message
Xavier ALT (dex-phx) wrote :

Ok, now a patch backward compatible with python2.4 ;-)

Revision history for this message
Christophe Simonis (OpenERP) (kangol) wrote :

fixed by 1579 <email address hidden>

Changed in openobject-server:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.