Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
4 Vastaukset
12556 Näkymät

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

Avatar
Hylkää
Paras vastaus

In odoo 13, use

request.session.debug

instead of 

request.debug
Avatar
Hylkää
Paras vastaus

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
Hylkää
Paras vastaus

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
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
huhtik. 18
4307
1
toukok. 16
3707
2
maalisk. 15
13127
0
heinäk. 25
38
1
heinäk. 25
327