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

I wanna detect debug mode in python side of openerp. How to to that?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

In odoo 13, use

request.session.debug

instead of 

request.debug
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

To enable OpenERP server debug mode, add flag --debug to start parameters. For example:

$ openerp-server -c .your_config --debug

To read more about python and OpenERP debugging, visit these links:

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi,

This is another way. I am not sure in the older versions.

self.user_has_groups('base.group_no_one')

Regards


Global Creative Concepts Tech Co Ltd.


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

This method returns True if debug mode is on, False otherwise :

from odoo.http import request
from odoo import models, api
class SomeClass(models.Model):
     _name = "some.class"
     @api.multi
     def debug_mode(self):
          return request.debug

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 18
4523
1
พ.ค. 16
3908
2
มี.ค. 15
13417
0
ส.ค. 25
901
0
ก.ค. 25
599