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

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
8月 25
1932
1
7月 25
2525
2
7月 25
7972
2
7月 25
4409
2
7月 25
4128