跳至内容
菜单
此问题已终结
4 回复
12800 查看

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

形象
丢弃
相关帖文 回复 查看 活动
1
4月 18
4529
1
5月 16
3912
2
3月 15
13421
0
8月 25
904
0
7月 25
600