Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
4 Răspunsuri
12277 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

In odoo 13, use

request.session.debug

instead of 

request.debug
Imagine profil
Abandonează
Cel mai bun răspuns

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:

Imagine profil
Abandonează
Cel mai bun răspuns

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.


Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
1
apr. 18
3993
1
mai 16
3486
2
mar. 15
12808
1
mai 25
530
0
apr. 25
2