Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4 Risposte
13098 Visualizzazioni

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

Avatar
Abbandona
Risposta migliore

In odoo 13, use

request.session.debug

instead of 

request.debug
Avatar
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
apr 18
4793
1
mag 16
4079
2
mar 15
13718
1
set 25
538
0
ago 25
1201