mirror of
https://github.com/odoo/documentation.git
synced 2026-01-02 17:59:20 +07:00
[IMP] qweb: document 't-cache' and 't-nocache' directives debug mode
related with: https://github.com/odoo/odoo/pull/88276
This commit is contained in:
@@ -606,9 +606,10 @@ for two main purposes:
|
||||
- provide some additional tools to help developer debug the Odoo interface.
|
||||
|
||||
The `debug` mode is described by a string. An empty string means that the `debug`
|
||||
mode is not active. Otherwise, it is active. If the string contains `assets` or
|
||||
`tests`, then the corresponding specific sub modes are activated (see below). Both
|
||||
modes can be active at the same time, for example with the string `assets,tests`.
|
||||
mode is not active. Otherwise, it is active. If the string contains `assets`,
|
||||
`disable-t-cache` or `tests`, then the corresponding specific sub modes are
|
||||
activated (see below). Both modes can be active at the same time, for example
|
||||
with the string `assets,tests`.
|
||||
|
||||
The `debug` mode current value can be read in the :ref:`environment<frontend/framework/environment>`:
|
||||
`env.debug`.
|
||||
@@ -635,6 +636,16 @@ The `debug=assets` sub mode is useful to debug javascript code: once activated,
|
||||
the :ref:`assets<reference/assets>` bundles are no longer minified, and source-maps
|
||||
are generated as well. This makes it useful to debug all kind of javascript code.
|
||||
|
||||
.. _frontend/framework/t_cache_debug_mode:
|
||||
|
||||
Disable `t-cache`
|
||||
-----------------
|
||||
|
||||
The `debug=disable-t-cache` sub mode is useful to debug python `t-cache` and
|
||||
`t-nocache` directives. By activating this debugging mode, the contents of the
|
||||
`t-cache` directives will be rendered each time. It is therefore possible to
|
||||
compare the real time rendering with that which is cached.
|
||||
|
||||
.. _frontend/framework/tests_debug_mode:
|
||||
|
||||
Tests mode
|
||||
|
||||
@@ -684,9 +684,9 @@ Will render (counter = 1)::
|
||||
<footer>(views: 10)</footer>
|
||||
</section>
|
||||
|
||||
Here the ``<i>`` tag that contains the container will always be rendered. While
|
||||
the rest is as a single string in the cache. The counter is not updated by the
|
||||
``t-set`` out of the ``t-nocache``
|
||||
Here the ``<header>`` and ``<i>`` tags will always be rendered. While the rest
|
||||
is as a single string in the cache. The counter is not updated by the ``t-set``
|
||||
out of the ``t-nocache``
|
||||
|
||||
``t-nocache-*`` add some primitive values in the cache
|
||||
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
@@ -713,6 +713,10 @@ Example::
|
||||
The value ``cached_value`` is cached with the cached template part of
|
||||
``t-cache="records"`` and add to the scoped root values each time.
|
||||
|
||||
.. seealso::
|
||||
- :ref:`Debug mode <frontend/framework/t_cache_debug_mode>`
|
||||
|
||||
|
||||
Helpers
|
||||
-------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user