OCA / pos

GNU Affero General Public License v3.0
283 stars 602 forks source link

[9.0] Pos_access_right: black screen when opening POS #223

Closed vdewulf closed 3 years ago

vdewulf commented 7 years ago

With version 9.0 on commit e520aab, when starting a new POS session with module pos_access_right installed, the POS screen is totally black, showing a javascript error:

http://localhost:8069/web/content/562-96c337a/point_of_sale.assets.js:370
Traceback:
gui.Gui.prototype.display_access_right@http://localhost:8069/web/content/562-96c337a/point_of_sale.assets.js:370:1
start@http://localhost:8069/web/content/562-96c337a/point_of_sale.assets.js:377:94
OdooClass.extend/Class.include/</prototype[name]</<@http://localhost:8069/web/content/422-89e8e19/web.assets_common.js:2537:368

Steps to reproduce the issue

vdewulf commented 7 years ago

@legalsylvain Have you seen the same problem recently? Thanks!

legalsylvain commented 7 years ago

Hi @vdewulf. No I did'nt face the problem. 2 things to investivage :

regards

vdewulf commented 7 years ago

Hello @legalsylvain.

legalsylvain commented 7 years ago

Hi @vdewulf. I reduced your comment. Only the first lines are interesting. So you can see (in debug mode nly) that the bug is in the line 24 of the module pos_access_right.js

https://github.com/OCA/pos/blob/9.0/pos_access_right/static/src/js/pos_access_right.js#L24

i have no clue why there is a bug, but if you make a PR to fix it, I'll review it .

If you do so, you could investigate in this recent commit in the core (september) : https://github.com/odoo/odoo/commit/e14ab697727d87773dbefba11453b9edca79fc68#diff-7079065c4c089eed7b36b138df35efdf

and maybe try to add a test like 'if user !== undefined here : https://github.com/OCA/pos/blob/9.0/pos_access_right/static/src/js/pos_access_right.js#L60

kind regards.

houssine78 commented 7 years ago

Hi @legalsylvain it seems that is not the user that is undefined but the user.groups_id

I've no idea why groups_id is no more provisionned but it leads to a big problem for pos extension as setting an if statement to avoid the black screen just make the functionnality not enabled.

any hint is welcome!

legalsylvain commented 6 years ago

Well adding a if statement doesn't seems to be the good choice. solution 1 : make a PR to fix the problem solution 2 : in the meantime, uninstall the buggy module. (well in fact, the bug appeared due to recent change in point of sale module).

houssine78 commented 6 years ago

Hi @legalsylvain it seems that this would fix the problem https://github.com/AwesomeFoodCoops/odoo-production/commit/fc1ca54233476d4b789d0c661da557804596db93

this fix concerns another module from you which is very similar by design and had the same black screen problem.

legalsylvain commented 6 years ago

Hi. Thanks. well the problem is that it is a patch of the core. Did you tried to make a PR againt Odoo ? regards.

houssine78 commented 6 years ago

Nope the patch is for the concerned modules. I've applied it on our repo and it fixed the problem pretty well.

houssine78 commented 6 years ago

I lack time to follow the PR process. I just put the info here in case of someone was search for a fix.