diff options
| author | aab-odoo <aab@odoo.com> | 2020-02-14 11:52:37 +0000 |
|---|---|---|
| committer | aab-odoo <aab@odoo.com> | 2020-02-14 13:01:57 +0000 |
| commit | f0a0cf5a6f58887a1c972d71145eb2e30be06c71 (patch) | |
| tree | cb5439574f3e323b63d738069cae5810e22f926b /addons/web/models | |
| parent | ed3e0b51ad7f4d5a948f37641f3d9a46421cb426 (diff) | |
[IMP] web: add odoo version to frontend session_info
This information is necessary for tours going from the backend to
the frontend (or the other way around) to run properly:
Some tour steps may be flagged with 'community' or 'enterprise',
meaning they must only be executed in the corresponding edition.
The TourManager filters the steps according to the edition. When
a tour is executed (either in test mode, automatically, or in an
onboarding situation, manually), the index of the current step is
stored in the local storage. So, the list of filtered steps must
be the same in the backend and in the frontend, which couldn't be
guaranteed as the frontend didn't have the information (thus always
considered being in community).
Part of task 2180175
closes odoo/odoo#45398
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Diffstat (limited to 'addons/web/models')
| -rw-r--r-- | addons/web/models/ir_http.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/addons/web/models/ir_http.py b/addons/web/models/ir_http.py index 00dcaeb7e99..fd4e3bc923e 100644 --- a/addons/web/models/ir_http.py +++ b/addons/web/models/ir_http.py @@ -76,13 +76,20 @@ class Http(models.AbstractModel): @api.model def get_frontend_session_info(self): - return { + session_info = { 'is_admin': request.session.uid and self.env.user._is_admin() or False, 'is_system': request.session.uid and self.env.user._is_system() or False, 'is_website_user': request.session.uid and self.env.user._is_public() or False, 'user_id': request.session.uid and self.env.user.id or False, 'is_frontend': True, } + if request.session.uid: + version_info = odoo.service.common.exp_version() + session_info.update({ + 'server_version': version_info.get('server_version'), + 'server_version_info': version_info.get('server_version_info') + }) + return session_info def get_currencies(self): Currency = request.env['res.currency'] |
