I was wondering if I can test if a user is logged in in the Javascript frontend?
I don't need the user ID, just that a user has logged in.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
1
الرد
2477
أدوات العرض
I worked it out:
odoo.define('something', function(require){
var session = require("session");
if (session.user_id !== false) console.log('User logged in')
});
it think it needs to be like this:
var session = require("web.session");
you need to write web.session in required statement.
thank you for your answer.
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيل