Skip to Content
Menu
This question has been flagged
1 Reply
1289 Views

The common syntax of record rules is ['|',('user_id','=',user.id),('user_id','=',False)]]

Is there any possiblilties we can use a python method to get the dynamic ids of user?

For Example

['|',('user_id','=',getuserid()),('user_id','=',False)]


Avatar
Discard
Best Answer

You can try something like, xml:

['|',('user_id','=', user.env["your.model"].get_userid().id), ('user_id','=',False)]

Py:

def get_userid(self):
    domain = []
    return self.env["res.user"].search(domain)

Let me know if this works for you.


Avatar
Discard