How can I set a default user as the current user in new API,
in the V7 :
'user_id': lambda obj, cr, uid, context: uid,
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
How can I set a default user as the current user in new API,
in the V7 :
'user_id': lambda obj, cr, uid, context: uid,
Hello,
You can try this one
user_id = fields.Many2one('res.users', string='My User',default=lambda self: self.env.user)
| 相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
|---|---|---|---|---|
|
1
12月 24
|
4910 | |||
|
1
2月 16
|
4482 | |||
|
1
3月 15
|
5952 | |||
|
0
3月 15
|
3872 | |||
|
1
3月 15
|
6397 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.