[6.1] exception from report not shown

Bug #917227 reported by Yannick Vaucher @ Camptocamp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Web (MOVED TO GITHUB)
Fix Released
Medium
Unassigned

Bug Description

Hello,

Some error aren't displayed in web client but are shown in GTK client.

Here is how to reproduce:

- Install a new DB with demo data.
- Install package eInvoicing & Payments
- Go in accounting -> Customer Invoice
--> Open Agrolait's invoice
- Try to print the report BVR Invoice

Result it does nothing... It must show the error to the user.
In server trace I can read :

[2012-01-16 15:55:31,419][?] INFO:werkzeug:127.0.0.1 - - [16/Jan/2012 15:55:31] "POST /web/session/eval_domain_and_context HTTP/1.1" 200 -
No LSB modules are available.
[2012-01-16 15:55:31,595][?] ERROR:web-services:[01]:
[2012-01-16 15:55:31,595][?] ERROR:web-services:[02]: Environment Information :
[2012-01-16 15:55:31,595][?] ERROR:web-services:[03]: System : Linux-2.6.32-37-generic-i686-with-Ubuntu-10.04-lucid
[2012-01-16 15:55:31,595][?] ERROR:web-services:[04]: OS Name : posix
[2012-01-16 15:55:31,595][?] ERROR:web-services:[05]: Distributor ID: Ubuntu
[2012-01-16 15:55:31,595][?] ERROR:web-services:[06]: Description: Ubuntu 10.04.3 LTS
[2012-01-16 15:55:31,595][?] ERROR:web-services:[07]: Release: 10.04
[2012-01-16 15:55:31,595][?] ERROR:web-services:[08]: Codename: lucid
[2012-01-16 15:55:31,595][?] ERROR:web-services:[09]: Operating System Release : 2.6.32-37-generic
[2012-01-16 15:55:31,595][?] ERROR:web-services:[10]: Operating System Version : #81-Ubuntu SMP Fri Dec 2 20:35:14 UTC 2011
[2012-01-16 15:55:31,596][?] ERROR:web-services:[11]: Operating System Architecture : 32bit
[2012-01-16 15:55:31,596][?] ERROR:web-services:[12]: Operating System Locale : en_US.UTF8
[2012-01-16 15:55:31,596][?] ERROR:web-services:[13]: Python Version : 2.6.5
[2012-01-16 15:55:31,596][?] ERROR:web-services:[14]: OpenERP-Server Version : 6.1beta
[2012-01-16 15:55:31,596][?] ERROR:web-services:[15]: Exception: (u'UserError', u'No bank specified on invoice:\nCI: V11 invoice')
[2012-01-16 15:55:31,596][?] ERROR:web-services:[16]: Traceback (most recent call last):
[2012-01-16 15:55:31,596][?] ERROR:web-services:[17]: File ".../server/openerp/service/web_services.py", line 725, in go
[2012-01-16 15:55:31,596][?] ERROR:web-services:[18]: (result, format) = obj.create(cr, uid, ids, datas, context)
[2012-01-16 15:55:31,596][?] ERROR:web-services:[19]: File ".../addons/report_webkit/webkit_report.py", line 329, in create
[2012-01-16 15:55:31,596][?] ERROR:web-services:[20]: result = self.create_source_pdf(cursor, uid, ids, data, report_xml, context)
[2012-01-16 15:55:31,596][?] ERROR:web-services:[21]: File ".../server/openerp/report/report_sxw.py", line 499, in create_source_pdf
[2012-01-16 15:55:31,596][?] ERROR:web-services:[22]: return self.create_single_pdf(cr, uid, ids, data, report_xml, context)
[2012-01-16 15:55:31,596][?] ERROR:web-services:[23]: File ".../addons/l10n_ch/report/report_webkit_html.py", line 199, in create_single_pdf
[2012-01-16 15:55:31,597][?] ERROR:web-services:[24]: self.parser_instance.set_context(objs, data, ids, report_xml.report_type)
[2012-01-16 15:55:31,597][?] ERROR:web-services:[25]: File ".../addons/l10n_ch/report/report_webkit_html.py", line 67, in set_context
[2012-01-16 15:55:31,597][?] ERROR:web-services:[26]: self._check(ids)
[2012-01-16 15:55:31,597][?] ERROR:web-services:[27]: File ".../addons/l10n_ch/report/report_webkit_html.py", line 131, in _check
[2012-01-16 15:55:31,597][?] ERROR:web-services:[28]: context={})[0][1]))
[2012-01-16 15:55:31,597][?] ERROR:web-services:[29]: except_osv: (u'UserError', u'No bank specified on invoice:\nCI: V11 invoice')
[2012-01-16 15:55:31,757][?] INFO:werkzeug:127.0.0.1 - - [16/Jan/2012 15:55:31] "POST /web/report HTTP/1.1" 500 -
[2012-01-16 15:55:31,761][?] ERROR:werkzeug:Error on request:
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/werkzeug/serving.py", line 159, in run_wsgi
    execute(app)
  File "/usr/local/lib/python2.6/dist-packages/werkzeug/serving.py", line 146, in execute
    application_iter = app(environ, start_response)
  File ".../server/openerp/wsgi.py", line 398, in application
    result = handler(environ, start_response)
  File ".../openerp-web/addons/web/common/http.py", line 436, in __call__
    return self.dispatch(environ, start_response)
  File "/usr/local/lib/python2.6/dist-packages/werkzeug/wsgi.py", line 411, in __call__
    return self.app(environ, start_response)
  File ".../openerp-web/addons/web/common/http.py", line 463, in dispatch
    result = handler( request, self.config)
  File ".../openerp-web/addons/web/common/http.py", line 300, in http_handler
    return HttpRequest(request, config).dispatch(controller, f)
  File ".../openerp-web/addons/web/common/http.py", line 255, in dispatch
    r = method(controller, self, **self.params)
  File ".../openerp-web/addons/web/controllers/main.py", line 1607, in index
    req.session._db, req.session._uid, req.session._password, report_id)
  File ".../openerp-web/addons/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File ".../openerp-web/addons/web/common/http.py", line 579, in send
    raise fault
Fault: <Fault warning -- UserError

No bank specified on invoice:
CI: V11 invoice: ''>

In GTK client everything is fine as an error is corectly poped

It is needed to show to the web user the error that is raised.

Regards,
Yannick

Related branches

Changed in openerp-web:
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

Issue should be fixed in trunk as of revision <email address hidden>

report errors should now yield the same nicely formatted dialogs as other RPC errors.

Changed in openerp-web:
status: In Progress → Fix Released
Revision history for this message
Florent (florent.x) wrote :

It seems you put the "import traceback" and "import werkzeug.exceptions" in the wrong module (rev. 2017).

Revision history for this message
Xavier (Open ERP) (xmo-deactivatedaccount) wrote :

> It seems you put the "import traceback" and "import werkzeug.exceptions" in the wrong module (rev. 2017).

Close, I initially added the new exception handling solely in the reports method (and added the corresponding imports to web.controllers.main) then realized it would be far more useful at the toplevel of http handling (in parallel with the JSON version), moved the handlers there but missed the imports I had added (web.common.http already imported werkzeug.exceptions and traceback so I did not have to add anything there).

And so I committed two unused modules to main.py.

I'll remove them, thanks for the note.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Thanks for the fix, I do have my nicely formatted dialogs now. :-)

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.