Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
6492 Widoki

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.

Awatar
Odrzuć

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

Najlepsza odpowiedź

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

Awatar
Odrzuć

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

Powiązane posty Odpowiedzi Widoki Czynność
0
lis 16
6292
0
gru 23
1979
2
sty 21
6423
2
mar 20
5361
1
paź 18
5390