跳至內容
選單
此問題已被標幟
1 回覆
9533 瀏覽次數


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
4156
1
2月 16
3748
1
3月 15
5202
0
3月 15
3100
1
3月 15
5653