How it works...

The tour manager is available under the web_tour.tour namespace.

In the first step, we imported web_tour.tour. We can then add a new tour with the register() function. We registered our tour with the library_tour name and passed the URL on which this tour should run.

The next parameter is a list of these tour steps. A tour step requires three values. The trigger is used to select the element on which the tour should be displayed. This is a JavaScript selector. We used the XML ID of the out menu, because it is available in the DOM.

The first step, tour.STEPS.SHOW_APPS_MENU_ITEM , is the predefined step from the tour for the main menu. The next key is the content, and this is displayed when the user hovers over the tour drop. We used the _t() function because we want to translate the string, while the position key is used to decide on the position of the tour drop. Possible values include top, right, left, or bottom.

The tours improve the onboarding experience of the user, as well as managing the integration tests. When you run Odoo with test mode internally, it also runs the tours and causes the test case to fail if a tour has not finished.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset