Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
6453 Vues

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
Ignorer

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

Meilleure réponse

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
Ignorer

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

Publications associées Réponses Vues Activité
0
nov. 16
6236
0
déc. 23
1961
2
janv. 21
6341
2
mars 20
5295
1
oct. 18
5354