OCA / web

Odoo web client UI related addons
GNU Affero General Public License v3.0
946 stars 1.89k forks source link

The solution to the OCA Web Responsive UI loading correctly, when the Odoo ERP System is proxy-ed by Nginx listening on 443 - HTTP2 #1926

Closed Rai-Mohammed closed 4 weeks ago

Rai-Mohammed commented 3 years ago

Odoo 12 CE ERP System proxy-ed by Nginx listening on 443 - HTTP2 - OCA Web Responsive UI loaded correctly

Unfortunately if you try to activate Nginx HTTP2 after installing Odoo OCA Web Responsive module, it will not work ( tested with Odoo 12, 13 and 14). The web login page will be displayed correctly, but the index page and menu don't shows, the HTTP2 stack work fine, and you will get a console error like bellow :

web.assets_common.js:3374 Uncaught Error: QWeb2: Template 'ControlPanel' not found at Object.exception (web.assets_common.js:3374) at Engine._render (web.assets_common.js:3419) at Engine.render (web.assets_common.js:3415) at Class.renderElement (web.assets_common.js:3674) at web.assets_common.js:3684 at web.assets_common.js:802 at fire (web.assets_common.js:796) at Object.add [as done] (web.assets_common.js:797) at Array.<anonymous> (web.assets_common.js:802) at Function.each (web.assets_common.js:625) web.assets_common.js:3374 Uncaught Error: QWeb2: Template 'CrashManager.error' not found at Object.exception (web.assets_common.js:3374) at Engine._render (web.assets_common.js:3419) at Engine.render (web.assets_common.js:3415) at Class.show_error (web.assets_backend.js:649) at window.onerror (web.assets_backend.js:558)

The solution to this problem, you have to personalize the parameter large_client_header_buffers in your Nginx proxy. The default is too low, change it at least to : _large_client_headerbuffers 4 32k;, congratulation you have a Responsive Web UI and HTTP2 protocol activated.

The Nginx parameter can be add to the documentation of the module OCA Web Responsive

Unfortunately for me, when I change the default language of the user to arabic, the Odoo UI is broken when loading the RTL Arabic translation and the CSS will not load correctly, plus the header Acceptance-Language don't include the arabic "ar_AR; ar" flags (View the last picture).

Nginx listening on 443 - HTTP2 proxing Odoo 12 CE ERP System - OCA modules Nginx listening on 443 - HTTP2 proxing Odoo 12 CE ERP System - OCA Responsive Broken Web UI Nginx listening on 443 - HTTP2 proxing Odoo 12 CE ERP System - OCA Responsive Web UI loaded correctelly Odoo broken UI when loading a RTL Arabic translation

pedrobaeza commented 3 years ago

This is an specific deployment question, and the module should be agnostic to that. Not sure if we should add such things.

Rai-Mohammed commented 3 years ago

This is an specific deployment question, and the module should be agnostic to that. Not sure if we should add such things.

@pedrobaeza no is not a specific deployment scenario, Odoo treat the python requirements by module name and with a specific version's tracking. And Odoo is tied to Nginx web server, and it can be the same for other kind of web server. I have searched many times for the cause that break the web UI when installing OCA Web responsive and the activation the HTTP2 protocol, and it isn't mentioned on any resources, from books or internet searche's. How can be an Odoo success deployment without the goodness of HTTP2, and surely the same issue will rise in the future with HTTP3.

pedrobaeza commented 3 years ago

It's not tied. I deploy with Traefik. Others with Apache...

Rai-Mohammed commented 3 years ago

It's not tied. I deploy with Traefik. Others with Apache...

Like I said "and it can be the same for other kind of web server", and is highly probable that the most deployment is with Nginx. And there is no harm to include the specificity of the other Web Servers. For me as Odoo newbie, is to get the deployment with the most or even all the features Speed, Productivity, Cutting edge Technology (HTTP3 is coming)

pedrobaeza commented 3 years ago

Then try to propose a generic redaction for it and do a pull request.

Rai-Mohammed commented 3 years ago

Then try to propose a generic redaction for it and do a pull request.

I never did a pull request. We can add something like this to the OCA Web Responsive README.rst

pedrobaeza commented 3 years ago

I let others to give their opinion. I see that such comment is partial and not related with web_responsive itself.

Rai-Mohammed commented 3 years ago

I let others to give their opinion. I see that such comment is partial and not related with web_responsive itself.

Done into OCA:12.0/web #1927, the PR is also applicable for branches (13,14), do we have to open others pull requests for them.

Thanks for your passion and to your responsive for many issues from the OCA community.

github-actions[bot] commented 2 months ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.