Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
6440 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
พ.ย. 16
6228
0
ธ.ค. 23
1960
2
ม.ค. 21
6341
Report in custom module แก้ไขแล้ว
2
มี.ค. 20
5291
1
ต.ค. 18
5345