跳至內容
選單
此問題已被標幟
1 回覆
6493 瀏覽次數

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.

頭像
捨棄

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

最佳答案

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

頭像
捨棄

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

相關帖文 回覆 瀏覽次數 活動
0
11月 16
6293
0
12月 23
1981
2
1月 21
6426
2
3月 20
5362
1
10月 18
5391