[IMP] all: replace <tree> in <list>

Remove historical error from semantically incorrect <tree>.

Viewtiverse
task-3599136
task-27709
task-3414068

closes odoo/documentation#8446

Related: odoo/odoo#159909
Related: odoo/enterprise#59787
Related: odoo/upgrade#5884
Signed-off-by: Christophe Matthieu (chm) <chm@odoo.com>
This commit is contained in:
Gorash
2024-02-01 17:06:06 +01:00
parent ea7fd9b847
commit f8a114b334
11 changed files with 76 additions and 79 deletions
@@ -75,7 +75,7 @@ A basic action for our `test_model` is:
<record id="test_model_action" model="ir.actions.act_window">
<field name="name">Test action</field>
<field name="res_model">test_model</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>
- ``id`` is an :term:`external identifier`. It can be used to refer to the record
@@ -83,7 +83,7 @@ A basic action for our `test_model` is:
- ``model`` has a fixed value of ``ir.actions.act_window`` (:ref:`reference/actions/window`).
- ``name`` is the name of the action.
- ``res_model`` is the model which the action applies to.
- ``view_mode`` are the views that will be available; in this case they are the list (tree) and form views.
- ``view_mode`` are the views that will be available; in this case they are the list and form views.
We'll see :doc:`later <14_qwebintro>` that there can be other view modes.
Examples can be found everywhere in Odoo, but
@@ -12,7 +12,7 @@ Views are defined in XML files with actions and menus. They are instances of the
In our real estate module, we need to organize the fields in a logical way:
- in the list (tree) view, we want to display more than just the name.
- in the list view, we want to display more than just the name.
- in the form view, the fields should be grouped.
- in the search view, we must be able to search on more than just the name. Specifically, we want a
filter for the 'Available' properties and a shortcut to group by postcode.
@@ -31,17 +31,17 @@ List
:align: center
:alt: List view
List views, also called tree views, display records in a tabular form.
List views, also called list views, display records in a tabular form.
Their root element is ``<tree>``. The most basic version of this view simply
Their root element is ``<list>``. The most basic version of this view simply
lists all the fields to display in the table (where each field is a column):
.. code-block:: xml
<tree string="Tests">
<list string="Tests">
<field name="name"/>
<field name="last_seen"/>
</tree>
</list>
A simple example can be found
`here <https://github.com/odoo/odoo/blob/6da14a3aadeb3efc40f145f6c11fc33314b2f15e/addons/crm/views/crm_lost_reason_views.xml#L46-L54>`__.
@@ -72,7 +72,7 @@ In practice a many2one can be seen as a dropdown list in a form view.
========================= ========================= =========================
- Add the menus as displayed in this section's **Goal**
- Add the field ``property_type_id`` into your ``estate.property`` model and its form, tree
- Add the field ``property_type_id`` into your ``estate.property`` model and its form, list
and search views
This exercise is a good recap of the previous chapters: you need to create a
@@ -179,7 +179,7 @@ operations like ``recs1 | recs2``.
========================= ========================= =========================
- Add the menus as displayed in this section's **Goal**
- Add the field ``tag_ids`` to your ``estate.property`` model and in its form and tree views
- Add the field ``tag_ids`` to your ``estate.property`` model and in its form and list views
Tip: in the view, use the ``widget="many2many_tags"`` attribute as demonstrated
`here <https://github.com/odoo/odoo/blob/5bb8b927524d062be32f92eb326ef64091301de1/addons/crm_iap_lead_website/views/crm_reveal_views.xml#L36>`__.
@@ -196,7 +196,7 @@ One2many
**Goal**: at the end of this section:
- a new ``estate.property.offer`` model should be created with the corresponding form and tree view.
- a new ``estate.property.offer`` model should be created with the corresponding form and list view.
- offers should be added to the ``estate.property`` model:
.. image:: 07_relations/property_offer.png
@@ -244,7 +244,7 @@ that accessing the data must be done in a loop::
property_id Many2one (``estate.property``) required
========================= ================================ ============= =================
- Create a tree view and a form view with the ``price``, ``partner_id`` and ``status`` fields. No
- Create a list view and a form view with the ``price``, ``partner_id`` and ``status`` fields. No
need to create an action or a menu.
- Add the field ``offer_ids`` to your ``estate.property`` model and in its form view as
depicted in this section's **Goal**.
@@ -70,10 +70,10 @@ a form view. For example:
<form>
<field name="description"/>
<field name="line_ids">
<tree>
<list>
<field name="field_1"/>
<field name="field_2"/>
</tree>
</list>
</field>
</form>
@@ -352,9 +352,9 @@ complete list):
.. code-block:: xml
<tree decoration-success="is_partner==True">
<list decoration-success="is_partner==True">
<field name="name"/>
</tree>
</list>
The records where ``is_partner`` is ``True`` will be displayed in green.