diff options
| author | Damien Bouvy <dbo@odoo.com> | 2015-11-18 15:26:43 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2015-11-25 18:12:42 +0100 |
| commit | 0a6edac151d6d34b264735729d6575b399dc6455 (patch) | |
| tree | 3affddcf5a194efba29ca5a05f576cf1e0da4573 /addons/web/controllers/main.py | |
| parent | e8e5405d0cafa460648b1bab5b144fb81ebd9508 (diff) | |
[FIX] web, openerp: make the webclient edition aware
- Differentiate between the Community and Enterprise editions
in the version number. By adding this attribute on the global
odoo JS object in the web client bootstrap controller /web,
we can differentiate between versions easily on the client
side without extra RPC calls.
- Remove a couple of version-related RPC calls in case
the global version info is present in the JS environment
- Update "About" panel to display the edition info
- This commit also reverts 07fe5afc874b9527eac5408d9adc53a9a700aad3
which implemented the idea in a more limited way.
Closes #9625
Diffstat (limited to 'addons/web/controllers/main.py')
| -rw-r--r-- | addons/web/controllers/main.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 44e6bca6e4d..f0f455be1e3 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -513,6 +513,13 @@ def binary_content(xmlid=None, model='ir.attachment', id=None, field='datas', un return (status, headers, content) +def db_info(): + version_info = openerp.service.common.exp_version() + return { + 'server_version': version_info.get('server_version'), + 'server_version_info': version_info.get('server_version_info'), + } + #---------------------------------------------------------- # OpenERP Web web Controllers #---------------------------------------------------------- @@ -533,7 +540,7 @@ class Home(http.Controller): request.uid = request.session.uid menu_data = request.registry['ir.ui.menu'].load_menus(request.cr, request.uid, request.debug, context=request.context) - return request.render('web.webclient_bootstrap', qcontext={'menu_data': menu_data}) + return request.render('web.webclient_bootstrap', qcontext={'menu_data': menu_data, 'db_info': json.dumps(db_info())}) @http.route('/web/dbredirect', type='http', auth="none") def web_db_redirect(self, redirect='/', **kw): |
