Skip to Content
Menu
This question has been flagged
4 Replies
11250 Views

I wanna detect debug mode in python side of openerp. How to to that?

Avatar
Discard
Best Answer

In odoo 13, use

request.session.debug

instead of 

request.debug
Avatar
Discard
Best Answer

To enable OpenERP server debug mode, add flag --debug to start parameters. For example:

$ openerp-server -c .your_config --debug

To read more about python and OpenERP debugging, visit these links:

Avatar
Discard
Best Answer

Hi,

This is another way. I am not sure in the older versions.

self.user_has_groups('base.group_no_one')

Regards


Global Creative Concepts Tech Co Ltd.


Avatar
Discard
Best Answer

This method returns True if debug mode is on, False otherwise :

from odoo.http import request
from odoo import models, api
class SomeClass(models.Model):
     _name = "some.class"
     @api.multi
     def debug_mode(self):
          return request.debug

Avatar
Discard
Related Posts Replies Views Activity
1
Apr 18
3362
1
May 16
2969
2
Mar 15
11721
0
Dec 24
13
4
Apr 24
170735