Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
6466 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ

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

Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ

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

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 16
6254
0
thg 12 23
1966
2
thg 1 21
6376
2
thg 3 20
5318
1
thg 10 18
5371