Odoo Help


Admin excluded from domain- is it possible?

Andrija Burlic
on 2/19/15, 8:02 AM 708 views

I have this piece of code:


    <record id="request_tree" model="ir.ui.view" >
    <field name="domain">[('responsible_user_referent','=',uid)]</field>
      <field name="name">request.tree</field>
      <field name="model">pio.request</field>
      <field name="arch" type="xml">
        <tree .................... </tree>


Obviously, I want to filter this view, to show only requests where responsible_user_referent is current user-> currently logged user can only see his own requests. This domain works fine, but I want to allow admin to see all requests in system. Is this possible and how? Currently admin can only see his own requests, like every other user...


Thanks in advance!

On 2/19/15, 10:12 AM

Try this way: [('responsible_user_referent','=',uid),('superuser_id','=',uid)]

I tried that, but w/o success. I used workaround- I created new menu item for admin- menu that shows all requests and it's visible only for admin... Anyway, thank you for answer!

Andrija Burlic
on 2/20/15, 4:21 AM

It's pseudo code, not complete code, I just gave you direction. In order to get worked above code, you could add computed(functional) integer field, named as 'superuser_id', and it's computing function should return always SUPERUSER_ID (i.e. 'superuser_id' field should be computed to SUPERUSER_ID). In openerp/odoo you can import SUPERUSER_ID as follows: from openerp import SUPERUSER_ID. Separated menu that you've done also good workaround, cheers

on 2/23/15, 4:16 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 2/19/15, 8:02 AM
Seen: 708 times
Last updated: 3/16/15, 8:10 AM