Commit Graph
13 Commits
Author SHA1 Message Date
Julien Mougenot a94914d775 [FIX] web_tour: Give correct access when reading modules
Tours are automatically disabled when the demo data are enabled on
at least one module. To ensure that, when giving the session_info
object, we read on the `ir.module.module` model to check whether some
of them have demo data.

Before this commit, this check only relied on the user's `is_admin`
flag, which does not give read access on the `ir.module.module` model.

Now, a `sudo` ensures that any admin user can read on the model.

closes odoo/odoo#76864

X-original-commit: 3a8d30d51a392f42d83d24b5f865f77b05205b50
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2021-09-20 19:04:06 +00:00
Julien MougenotandSimon Genin e0efbb08a4 [IMP] web_tour: add tour 'disabled' option
This commit changes the way tours are automatically disabled when in
demo data.

Previously, an override of the assets_common template was applied by a
file loaded in the web_tour demo data, ensuring that the tours are
disabled when demo data are loaded in the database.

Now, a "tour_disable" boolean will be given to the session_info object
to determine whether the tour manager must be disabled, meaning that it
will automatically consume all registered tours.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Aaron Bohy 66c716d781 [FIX] *: adapt calls to _is_superuser
Rev. 2f7c03d added a second admin user (id 2), the 'human' one, on
top of the 'technical' one (id 1, also known as the superuser).
Basically, all calls to _is_superuser() should have been changed to
_is_admin(). They weren't. As a consequence, some features that
were previously available for the admin weren't anymore (e.g.
tours).

This rev. replaces all calls to _is_superuser() by calls to
_is_admin().
2018-09-18 20:31:28 +02:00
Yannick Tivisse 7e008469e4 [IMP] base: Always load menuitem xmlids on templates
PURPOSE
=======

Currently we can choose to load the xmlid of a menuitem if web_tour is installed by setting the attribute `load_xmlid=True` on the view.

This is strange for 2 reasons:
- Searching all the ir.model.data on menuitems with load_xmlid=True to compute its xmlid, searching the related subtree on the returned structure of the method load_menus is quite complicated for the perfomance gain (if there is any perfomance gain to do it)
- This is not working in community in frontend, as only the root menuitems are loaded, thus it is the `load_menus_root` instead of the `load_menus` that is called. This issue prevent a tour step to be displayed correctly on community and enterprise on a menuitem.

SPECIFICATION
=============

Remove all the `load_xmlid` attributes and the related mechanism and move it into base to always load the xmlids for all the menuitems. It won't bee to heavy as the result is cached.

It's better the keep the current mechanism (Load the xmlids from ir.model.data and insert them into the tree) as we only make 1 search to the ir.model.data
2017-05-26 13:13:12 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Raphael Collet 6453e4eb23 [IMP] base: tighten ir.model.data access rights 2017-01-03 16:52:50 +01:00
fwi-odoo 9a0c20d803 [MOV][IMP] web_tour: reorganize files, clean imports, replace openerp tags and add license 2016-08-03 13:42:26 +02:00
Aaron Bohy 0a8ec45769 [IMP] web_tour: add button to consume all tours in debug_manager
Changes the api of the consume method on the web_tour.tour model so that it
now takes in argument an array of tour names instead of a single tour name.
2016-07-20 17:59:48 +02:00
Simon Lejeune d1cd293ece [FIX] web: session_info: introduce is_superuser key
This is done in order to enable the tour service only for the
superuser. Commit 6ef1644a7b changed the meaning of `is_admin`
to achieve this but broke the fact that some features of the debug
manager are available to admin and not only to the superuser. Anyway
a `is_admin` key should mean that the user is in the admin group.

We could have checked client side that the uid is equal to 1 but
adding a `is_superuser` key is more elegant and easier to grep.
Also fix the only occurence of a uid check in the weblcient.

This reverts commit 6ef1644a7b.
2016-07-20 14:16:01 +02:00
Christophe Simonis 9e9369acc0 [FIX] web_tour: still keep ir.http abstract 2016-07-04 14:39:49 +02:00
Aaron Bohy 8d61316486 [FIX] web_tour: load consumed tours in the frontend
Also deactivate unnecessary magic fields for the web_tour model.
2016-06-27 10:59:39 +02:00
Aaron Bohy 38bb6a7f81 [ADD] openerp,web,web_tour: new web_tour addon
Join work with ged
2016-06-16 14:59:40 +02:00