From be0d5a49a0779628c0015d5d7e9c00d349e9b91f Mon Sep 17 00:00:00 2001 From: "Francois Vasamillet (frva)" Date: Thu, 8 May 2025 13:04:56 +0000 Subject: [PATCH] [FIX] tutorials: Fix js and website action (importable_modules.rst) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Url path to access server action updated from /actions to /website/action Added xml record that Javascript tour was missing to work properly closes odoo/documentation#13283 X-original-commit: 4efa5133d667328375ac2db857c8813c8e67f3fc Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: François Vasamillet (frva) --- .../tutorials/importable_modules.rst | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/content/developer/tutorials/importable_modules.rst b/content/developer/tutorials/importable_modules.rst index d030d4076..29be9d053 100644 --- a/content/developer/tutorials/importable_modules.rst +++ b/content/developer/tutorials/importable_modules.rst @@ -821,7 +821,7 @@ In data modules, it is possible to define server actions that behave as controll the website module is installed. When the website module is installed, server actions can be marked as `Available on the website` -and given a path (the full path is always prefixed with `/actions` to avoid URL collisions); +and given a path (the full path is always prefixed with `/website/action` to avoid URL collisions); the global `request` object is made available in the local scope of the code server action. The `request` object provides several methods to access the body of the request: @@ -835,7 +835,7 @@ to return, one can assign a response-like object to the `response` variable, whi returned to the website automatically. Here is an example of a simple website controller that will return a list of properties -when the URL `/actions/estate` is called: +when the URL `/website/action/estate` is called: .. code-block:: xml @@ -898,7 +898,7 @@ by using `sudo` to access records). #. add a record rule so that properties marked as `x_api_published` can be read by the public user #. add a server action to return a list of properties in JSON format when the URL - `/actions/api/estate` is called + `/website/action/estate` is called A sprinkle of JavaScript ======================== @@ -921,11 +921,9 @@ A very minimal tour with a single step can be added by adding this file in `stat registry.category("web_tour.tours").add('estate_tour', { url: "/web", - sequence: 170, steps: () => [{ trigger: '.o_app[data-menu-xmlid="estate.menu_root"]', content: 'Start selling your properties from this app!', - position: 'bottom', }], }); @@ -943,6 +941,17 @@ You then need to include the file in the appropriate bundle in the manifest file }, } +You also need to add an xml record in a new estate_tour.xml file in the data folder so that your +tour is displayed: + +.. code-block:: xml + + + estate_tour + 2 + Welcome! Happy exploring. + + .. note:: Unlike normal Python modules, glob expansion is not supported in importable modules; so you need to list each file you want to include in the module specifically.