Compare commits

...

3 Commits

Author SHA1 Message Date
Aaron Bohy 5fb693c4bc [IMP] reference/user interface: remove kanban-tooltip doc
This feature has been dropped.

(Part of) task `3650117`
2024-06-17 08:15:54 +02:00
Aaron Bohy 4842d0e133 [IMP] reference/user interface: kanban: color attribute
(Part of) task `3650117`
2024-06-17 08:15:54 +02:00
Aaron Bohy 82b4154b69 [IMP] reference/user interface: kanban: can_open attribute
(Part of) task `3650117`
2024-06-17 08:15:54 +02:00
2 changed files with 22 additions and 8 deletions
@@ -2485,6 +2485,24 @@ Optional attributes can be added to the root element `kanban` to customize the v
:type: str
:default: `''`
.. attribute:: can_open
:noindex:
By default, clicking on a kanban card opens the corresponding record in a form view.
This behavior can be disabled by setting the attribute `can_open` to `False`.
:requirement: Optional
:type: bool
:default: `True`
.. attribute:: highlight_color
:noindex:
Name of the integer field used to color the left border of the kanban cards.
:requirement: Optional
:type: str
.. include:: view_architectures/root_attribute_sample.rst
.. include:: view_architectures/root_attribute_banner_route.rst
@@ -2672,10 +2690,8 @@ the kanban cards.
Cards structure definition can be split into multiple templates for clarity, but at least one root
template `kanban-box` must be defined.
Two additional templates can be defined: `kanban-menu` and `kanban-tooltip`. If defined, the
`kanban-menu` template is rendered inside a dropdown that can be toggled with a vertical ellipsis
(:guilabel:`⋮`) on the top right of the card. The `kanban-tooltip` template is rendered inside a
tooltip when hovering kanban cards.
An additional template can be defined: `kanban-menu`. If defined, it is rendered inside a dropdown
that can be toggled with a vertical ellipsis (:guilabel:`⋮`) on the top right of the card.
The templates are written in :ref:`JavaScript QWeb <reference/qweb/javascript>`
@@ -45,7 +45,7 @@ looks like:
<kanban>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div>
<field name="name"/>
</div>
</t>
@@ -58,8 +58,6 @@ Let's break down this example:
least one root template ``kanban-box``, which will be rendered once for each record.
- ``<t t-name="kanban-box">``: ``<t>`` is a placeholder element for QWeb directives. In this case,
it is used to set the ``name`` of the template to ``kanban-box``
- ``<div class="oe_kanban_global_click">``: the ``oe_kanban_global_click`` makes the ``<div>``
clickable to open the record.
- ``<field name="name"/>``: this will add the ``name`` field to the view.
.. exercise:: Make a minimal kanban view.
@@ -79,7 +77,7 @@ conditionally, we can use the ``t-if`` directive (see :ref:`reference/qweb/condi
<field name="state"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div>
<field name="name"/>
<div t-if="record.state.raw_value == 'new'">
This is new!