I'm trying to hide the debug code from seesion expired error, so i need to override the _handle_exception method to delete debug code from exception. Can anyone explain how to do this ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- Müşteri İlişkileri Yönetimi
- e-Commerce
- Muhasebe
- Envanter
- PoS
- Project
- MRP
This question has been flagged
1
Cevapla
4985
Görünümler
Hi Kitty,
You can do it like this.
Inside the controller,
from odoo.addons.base.ir import ir_http
class IrHttp(ir_http.IrHttp):
@classmethod
def _handle_exception(cls, exception):
# If handle_exception returns something different than None, it will be used as a response
# This is done first as the attachment path may
# not match any HTTP controller
if isinstance(exception, werkzeug.exceptions.HTTPException) and exception.code == 404:
attach = cls._serve_attachment()
if attach:
return attach
# Don't handle exception but use werkeug debugger if server in --dev mode
if 'werkzeug' in tools.config['dev_mode']:
raise
try:
return request._handle_exception(exception)
except AccessDenied:
return werkzeug.exceptions.Forbidden()
Thanks
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye OlRelated Posts | Cevaplar | Görünümler | Aktivite | |
---|---|---|---|---|
|
1
May 25
|
730 | ||
|
0
Şub 22
|
2762 | ||
|
2
Oca 22
|
2859 | ||
|
2
Oca 22
|
3925 | ||
|
0
Eyl 21
|
200 |
I need to override def in http.py class JSONRequest method _handle_exception