تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
4 الردود
12569 أدوات العرض

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
أبريل 18
4312
1
مايو 16
3715
2
مارس 15
13132
0
يوليو 25
88
1
يوليو 25
352