Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
4 Odpovědi
12652 Zobrazení

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

Avatar
Zrušit
Nejlepší odpověď

In odoo 13, use

request.session.debug

instead of 

request.debug
Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
dub 18
4379
1
kvě 16
3806
2
bře 15
13227
0
srp 25
372
0
čvc 25
229