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?
Example
['|',('user_id','=',getuserid()),('user_id','=',False)]
This question has been flagged
1
Reply
1694
Views
Hii Shashank ,
You can try this below code:
['|',('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)
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up