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

Hi, i want to check if developer mode is active inside a function, so if is active i will send a more descriptive error message inside a function that can raise and exception, and if is not active i will only show a simple error to user.

Avatar
Hylkää

Hello

Reinhart

Here you can get your solution.

Write bellow code in your method you can easily get active mode status.

from openerp.http import request

and check weather debug mode active or not.

print "====Checking Debug mode active or not=====", request.debug

Paras vastaus

Two options that come to mind are using has_group('base.group_no_one') on the logged in user, or checking if the URL contains debug=.

Good Luck,

Jake Robinson

Avatar
Hylkää

Hello

Reinhart

Here you can get your solution.

Write bellow code in your method you can easily get active mode status.

from openerp.http import request

and check weather debug mode active or not.

print "====Checking Debug mode active or not=====", request.debug

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
marrask. 16
6283
0
jouluk. 23
1973
2
tammik. 21
6415
2
maalisk. 20
5353
1
lokak. 18
5385