Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
9652 มุมมอง


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) 
อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 24
4284
1
ก.พ. 16
3848
1
มี.ค. 15
5300
0
มี.ค. 15
3192
1
มี.ค. 15
5759