muk-it / muk_web

MuK Odoo Web Modules
GNU Lesser General Public License v3.0
108 stars 230 forks source link

Error when opening a session about chatter_position #190

Open ossimantylahti opened 2 years ago

ossimantylahti commented 2 years ago

It seems that Mukit Odoo background theme has an error regarding chatter_position. When logging in to the system with only Mukit background theme extension installed, there is a brief error message popping up:

image

The error is following:

Traceback:
TypeError: Cannot read properties of undefined (reading 'chatter_position')
    at https://<odooserver address>/web/content/546-1962ada/web.assets_backend.js:4000:326

The error stays on the screen for a fraction of a second and then disappears.

Tested on Odoo 13 CE.

nguyenductamlhp commented 2 years ago

@ossimantylahti I met this issue in case of OdooBot user. The reason is OdooBot is archived that it can not read data of this user

ossimantylahti commented 2 years ago

@ossimantylahti I met this issue in case of OdooBot user. The reason is OdooBot is archived that it can not read data of this user

Ok... so how to fix it? Any ideas?

nguyenductamlhp commented 2 years ago

My idea is editing on muk_web_theme > file action.js: add domain to filter both active and inactive user:

rpc.query({
        model: 'res.users',
        method: 'search_read',
        args: [[['id', '=', session.uid]], ['chatter_position']]
    }).then(function (pos) {
        var position = pos[0]['chatter_position'];
...

Replace ['id', '=', session.uid] by ['id', '=', session.uid], '|', ['active', '=', True], ['active', '=', False]