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)]
Câu hỏi này đã bị gắn cờ
1
Trả lời
1789
Lượt xem
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
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký