muk-it / muk_web

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

[12.0][muk_web_branding] Issue on clean installation #79

Closed spacimek closed 5 years ago

spacimek commented 5 years ago

These are the steps I have performed on latest Odoo 12C + latest MuK modules from pip, on a new server. They result in issue below - do you please have any advice on what am I doing wrong?

1) Install muk_saas_branding before DB initialization (in conf I am just using database_manager_system_name) 2) Initialize the DB and install muk_branding (+I've installed just CRM + Project + Website) 3) Install muk_web_branding (12.0.1.1.2) (+muk_website_branding 12.0110 goes along, but the error is still there after uninstalling this one) 4) Go to Setting > General Settings = Error below (uninstalling muk_web_branding grants access to General Settings again).

I see nothing special in the logs: 2019-04-15 01:42:15,606 16409 INFO otvybor.cz werkzeug: 185.228.138.118 - - [15/Apr/2019 01:42:15] "POST /web/dataset/call_kw/res.config.settings/default_get HTTP/1.1" 200 - 67 0.051 0.050 2019-04-15 01:42:16,015 16409 INFO otvybor.cz werkzeug: 185.228.138.118 - - [15/Apr/2019 01:42:16] "POST /web/dataset/call_kw/res.config.settings/onchange HTTP/1.1" 200 - 43 0.033 0.152 2019-04-15 01:42:16,416 16409 INFO otvybor.cz werkzeug: 185.228.138.118 - - [15/Apr/2019 01:42:16] "POST /web/dataset/call_kw/res.lang/read HTTP/1.1" 200 - 3 0.002 0.006 2019-04-15 01:42:16,627 16409 INFO otvybor.cz werkzeug: 185.228.138.118 - - [15/Apr/2019 01:42:16] "POST /web/dataset/call_kw/website/name_get HTTP/1.1" 200 - 2 0.002 0.010 2019-04-15 01:42:16,630 16409 INFO otvybor.cz werkzeug: 185.228.138.118 - - [15/Apr/2019 01:42:16] "POST /web/dataset/call_kw/digest.digest/name_get HTTP/1.1" 200 - 2 0.003 0.010 2019-04-15 01:42:16,844 16409 INFO otvybor.cz werkzeug: 185.228.138.118 - - [15/Apr/2019 01:42:16] "POST /web/dataset/call_kw/website/name_search HTTP/1.1" 200 - 3 0.006 0.012 2019-04-15 01:42:16,848 16409 INFO otvybor.cz werkzeug: 185.228.138.118 - - [15/Apr/2019 01:42:16] "POST /web/dataset/call_kw/res.lang/name_search HTTP/1.1" 200 - 3 0.005 0.009 2019-04-15 01:42:17,090 16409 INFO otvybor.cz werkzeug: 185.228.138.118 - - [15/Apr/2019 01:42:17] "POST /config/muk_web_utils.binary_max_size HTTP/1.1" 200 - 1 0.001 0.005 2019-04-15 01:42:17,135 16409 INFO otvybor.cz werkzeug: 185.228.138.118 - - [15/Apr/2019 01:42:17] "POST /config/muk_web_utils.binary_max_size HTTP/1.1" 200 - 1 0.001 0.006

This is the error I get in Firefox: TypeError: this.getFocusableElement(...) is undefined

This one show in Chrome: Uncaught TypeError: Cannot read property 'attr' of undefined

But in any case the both have basically the same stack: https://otvybor.cz/web/content/700-124207e/web.assets_backend.js:1043 Traceback: TypeError: Cannot read property 'attr' of undefined at Class.setIDForLabel (https://otvybor.cz/web/content/700-124207e/web.assets_backend.js:1043:536) at Class.setIDForLabel (https://otvybor.cz/web/content/700-124207e/web.assets_backend.js:1070:58) at Class.prototype.(anonymous function) [as setIDForLabel] (https://otvybor.cz/web/content/699-50d4747/web.assets_common.js:3538:488) at Class._setIDForLabel (https://otvybor.cz/web/content/700-124207e/web.assets_backend.js:1646:132) at Class._postProcessField (https://otvybor.cz/web/content/700-124207e/web.assets_backend.js:1616:66) at https://otvybor.cz/web/content/700-124207e/web.assets_backend.js:1579:271 at https://otvybor.cz/web/content/699-50d4747/web.assets_common.js:802:681 at fire (https://otvybor.cz/web/content/699-50d4747/web.assets_common.js:796:299) at Object.add [as done] (https://otvybor.cz/web/content/699-50d4747/web.assets_common.js:797:467) at Array. (https://otvybor.cz/web/content/699-50d4747/web.assets_common.js:802:649)

gaikaz commented 5 years ago

Had the same issue. Was planning to write this issue as well.

It seems that the problem is with upgrade.js script. As I understand, it removes the Enterprise upgrade asking checkboxes from settings. It probably should just hide them, so other scripts still can find them.

Until muk fixes this, you can simply comment out this script. I have a made fork of this repo for that purpose for now.

Edit: To make this faster for anyone searching, Temporary fix would be to comment/remove line 45 in file muk_web_branding/template/assets.xml and upgrade/install the module. Like so:

<script type="text/javascript" src="/muk_web_branding/static/src/js/chrome/menu.js"/>
<!-- <script type="text/javascript" src="/muk_web_branding/static/src/js/fields/upgrade.js"/> -->
<script type="text/javascript" src="/muk_web_branding/static/src/js/views/dashboard.js"/>
keshrath commented 5 years ago

https://github.com/muk-it/muk_web/commit/56af9993ab23c7f66582a992487a677048809d41

Can you confirm, that this fixes your issue?

gaikaz commented 5 years ago

Thanks for your fast response, @keshrath :) Sadly, this didn't fix it. I went ahead and tried to reproduce it on a fresh Odoo 12.0 install with a fresh empty DB, just by installing this module. And I did get the same error.

Here is how it looks with debug+assets, so it's easier to trace:

Error:
Uncaught TypeError: Cannot read property 'attr' of undefined

https://example.com/web/static/src/js/fields/abstract_field.js:324
Traceback:
TypeError: Cannot read property 'attr' of undefined
    at Class.setIDForLabel (https://example.com/web/static/src/js/fields/abstract_field.js:324:35)
    at Class.setIDForLabel (https://example.com/web/static/src/js/fields/basic_fields.js:838:21)
    at Class.prototype.(anonymous function) [as setIDForLabel] (https://example.com/web/static/src/js/core/class.js:90:38)
    at Class._setIDForLabel (https://example.com/web/static/src/js/views/form/form_renderer.js:993:16)
    at Class._postProcessField (https://example.com/web/static/src/js/views/form/form_renderer.js:359:14)
    at https://example.com/web/static/src/js/views/basic/basic_renderer.js:617:18
    at https://example.com/web/static/lib/jquery/jquery.js:3276:89
    at fire (https://example.com/web/static/lib/jquery/jquery.js:3119:58)
    at Object.add [as done] (https://example.com/web/static/lib/jquery/jquery.js:3165:49)
    at Array.<anonymous> (https://example.com/web/static/lib/jquery/jquery.js:3275:77)

Hopefully this helps.

keshrath commented 5 years ago

https://github.com/muk-it/muk_web/commit/71e1834859e475f1ccd2ffa4e107d71196527c31

spacimek commented 5 years ago

Thanks, guys! Yes, I can confirm that issue is fixed!

Steps: 1) Uninstall muk_web_branding (+website_branding) 2) Get latest modules on pip: odoo12-addon-muk-saas-branding 12.0.1.0.3 odoo12-addon-muk-web-branding 12.0.1.1.5 3) Upgrade muk_saas_branding 4) Install muk_web_branding again. 5) Enjoy General Settings!

MosabWadea commented 5 years ago

I am afraid this is not solved yet! I have pulled latest updates from git repo and tried the same steps @spacimek mentioned, but still same issue!