Help

1

How to detect debug mode in python side?

Avatar
sepdau

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

アバター
Discard
4 回答
0

In odoo 13, use

request.session.debug

instead of 

request.debug
アバター
Discard
1

Hi,

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

self.user_has_groups('base.group_no_one')

Regards

Shameem Babu P K

Global Creative Concepts Tech Co Ltd.


アバター
Discard
1
Avatar
Antanas
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:

アバター
Discard
0
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

アバター
Discard