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)]
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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)]
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.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up