I need to get current user in function fetch_from_channel in chat_manager.js in addon mail
I tried to use self.session.uid. But its not working in this file.
And i need to get this without using python function
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
I need to get current user in function fetch_from_channel in chat_manager.js in addon mail
I tried to use self.session.uid. But its not working in this file.
And i need to get this without using python function
var session = require('web.session');
user = session.uid
Important: js is asyncronous. Make sure, all the data about the session is uploaded to the time when you are trying to retrieve the data. E.g. console.log(session). What is kept there, when you try to get the active user?
Thanks, it works fine now
In Odoo 12 you can get the current user ID like this
var session = require('web.session');
...var user = session.uid
console.log('user >>>> ', user)
var session = require('web.session');
user = session.user_id
I got result while putting session.user_id in my code.
This works fine for me. Thank you MITUL SHAH
Check the context, dataset,