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

I want to retrieve the current user in a form:


var session = require('web.session');
user = session.uid


I get require is not defined.


Thank you

頭像
捨棄
作者

Thank you

最佳答案

Hi!,

Try this code:

context = self._context
user = context.get('uid')


Hope it work for you!

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
7月 25
2467
2
7月 25
7920
2
7月 25
4338
2
7月 25
4073
2
6月 25
2668