summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorRomeo Fragomeli <rfr@odoo.com>2019-10-15 08:31:09 +0000
committerAdrien Dieudonne <adr@odoo.com>2019-10-18 12:41:39 +0000
commit9831ed08fe60f36244e8e941012ca6866cab3e16 (patch)
tree2d071076492d9ff69bb0b0b7bb95c032d713b299 /addons
parent0d2f04685124cd397e5e3e24ad360a9266a44313 (diff)
[IMP] web: force desktop mode on mobile
Before this commit, some views appeared broken on mobile. We don't consider this as a bug because Odoo is not supposed to be responsive in Community edition. This feature is only available on Enterprise. This commit aims at clarifying this situation by clearly moving the base requirements to support browsers' responsive to the Enterprise edition and stating that the Community edition only targets desktop. It's important to note that, for technical reasons, some responsive-related JS/CSS code may still be present in the Community codebase but they are not meant to provide any explicit or implicit support for responsive/mobile devices. Technically speaking, this commit removes the viewport meta tag. This change will then force the "desktop-like" rendering even on small screens for the Community edition and will keep the current behavior (scaling/zooming on small screens) for the Enterprise edition. By doing this we do not let the users think that something is broken and must be fixed. So, in Community edition, desktop is always displayed; In Enterprise edition, Responsive Web Design is available. We also had to adapt a test to be able to apply XPath adding viewport meta tag in enterprise. Task ID: 2090202
Diffstat (limited to 'addons')
-rw-r--r--addons/web/tests/test_js.py2
-rw-r--r--addons/web/views/webclient_templates.xml1
2 files changed, 1 insertions, 2 deletions
diff --git a/addons/web/tests/test_js.py b/addons/web/tests/test_js.py
index 71e96c8b3b8..2547a82d978 100644
--- a/addons/web/tests/test_js.py
+++ b/addons/web/tests/test_js.py
@@ -22,7 +22,7 @@ class WebSuite(odoo.tests.HttpCase):
def _check_only_call(self, suite):
# As we currently aren't in a request context, we can't render `web.layout`.
# redefinied it as a minimal proxy template.
- self.env.ref('web.layout').write({'arch_db': '<t t-name="web.layout"><t t-raw="head"/></t>'})
+ self.env.ref('web.layout').write({'arch_db': '<t t-name="web.layout"><head><meta charset="utf-8"/><t t-raw="head"/></head></t>'})
for asset in self.env['ir.qweb']._get_asset_content(suite, options={})[0]:
filename = asset['filename']
diff --git a/addons/web/views/webclient_templates.xml b/addons/web/views/webclient_templates.xml
index 6de09a8379b..56a57751e03 100644
--- a/addons/web/views/webclient_templates.xml
+++ b/addons/web/views/webclient_templates.xml
@@ -417,7 +417,6 @@
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
<title t-esc="title or 'Odoo'"/>
<link type="image/x-icon" rel="shortcut icon" t-att-href="x_icon or '/web/static/src/img/favicon.ico'"/>