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

Normally I use this example of code to get record id:

@api.onchange('selector') def some(self):
        order_object = self.env['ir.ui.menu'] order_object_ids = order_object.search([('sequence', '=', 10)]) if order_object_ids:
            for obj in order_object_ids:
                 print obj.id       
But when I try to use constructor to get values, I receiving error:

AttributeError: 'ir.ui.menu' object has no attribute 'id' 

This is my constructor

def __init__(self, *args, **kwargs):
        registry = registry_get('main-db')
        r = modules.registry.RegistryManager.get('main-db')
        cr = r.cursor() with api.Environment.manage():
        env = api.Environment(cr, 1, {})
        obj = env['ir.ui.menu'].browse(161)
        print obj.id
        super(HumanResourcesBase, self).__init__(*args, **kwargs)


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مارس 15
3582
1
مارس 15
5248
1
أبريل 22
3628
1
يوليو 21
8522
9
فبراير 17
11190