I wanna detect debug mode in python side of openerp. How to to that?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- Project
- MRP
此問題已被標幟
4
回覆
12292
瀏覽次數
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
|
4037 | ||
|
1
5月 16
|
3503 | ||
|
2
3月 15
|
12826 | ||
|
1
5月 25
|
566 | ||
|
0
4月 25
|
2 |