mirror of
https://github.com/odoo/documentation.git
synced 2026-01-02 01:39:19 +07:00
[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:
@@ -273,7 +273,7 @@ action more easily.
|
||||
<record model="ir.actions.act_window" id="action_list_ideas">
|
||||
<field name="name">Ideas</field>
|
||||
<field name="res_model">idea.idea</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
</record>
|
||||
<menuitem id="menu_ideas" parent="menu_root" name="Ideas" sequence="10"
|
||||
action="action_list_ideas"/>
|
||||
@@ -321,7 +321,7 @@ is implied by the root element of the ``arch`` field:
|
||||
<field name="model">object_name</field>
|
||||
<field name="priority" eval="16"/>
|
||||
<field name="arch" type="xml">
|
||||
<!-- view content: <form>, <tree>, <graph>, ... -->
|
||||
<!-- view content: <form>, <list>, <graph>, ... -->
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -330,20 +330,20 @@ is implied by the root element of the ``arch`` field:
|
||||
|
||||
The ``arch`` field must thus be declared as ``type="xml"`` to be parsed correctly.
|
||||
|
||||
Tree views
|
||||
list views
|
||||
----------
|
||||
|
||||
Tree views, also called list 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 simplest form of the tree view simply
|
||||
Their root element is ``<list>``. The simplest form of the list view simply
|
||||
lists all the fields to display in the table (each field as a column):
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<tree string="Idea list">
|
||||
<list string="Idea list">
|
||||
<field name="name"/>
|
||||
<field name="inventor_id"/>
|
||||
</tree>
|
||||
</list>
|
||||
|
||||
.. _howtos/module/views/form:
|
||||
|
||||
@@ -716,7 +716,7 @@ field whenever some of its dependencies have been modified::
|
||||
.. exercise:: Computed fields
|
||||
|
||||
* Add the percentage of taken seats to the *Session* model
|
||||
* Display that field in the tree and form views
|
||||
* Display that field in the list and form views
|
||||
* Display the field as a progress bar
|
||||
|
||||
Default values
|
||||
@@ -845,10 +845,10 @@ and ``message`` is the error message.
|
||||
Advanced Views
|
||||
==============
|
||||
|
||||
Tree views
|
||||
list views
|
||||
----------
|
||||
|
||||
Tree views can take supplementary attributes to further customize their
|
||||
list views can take supplementary attributes to further customize their
|
||||
behavior:
|
||||
|
||||
``decoration-{$name}``
|
||||
@@ -872,20 +872,20 @@ behavior:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<tree string="Idea Categories" decoration-info="state=='draft'"
|
||||
<list string="Idea Categories" decoration-info="state=='draft'"
|
||||
decoration-danger="state=='trashed'">
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</list>
|
||||
|
||||
``editable``
|
||||
Either ``"top"`` or ``"bottom"``. Makes the tree view editable in-place
|
||||
Either ``"top"`` or ``"bottom"``. Makes the list view editable in-place
|
||||
(rather than having to go through the form view), the value is the
|
||||
position where new rows appear.
|
||||
|
||||
.. exercise:: List coloring
|
||||
|
||||
Modify the Session tree view in such a way that sessions lasting less than
|
||||
Modify the Session list view in such a way that sessions lasting less than
|
||||
5 days are colored blue, and the ones lasting more than 15 days are
|
||||
colored red.
|
||||
|
||||
@@ -1173,7 +1173,7 @@ action may be triggered via a menu item, but is more generally triggered by a
|
||||
button.
|
||||
|
||||
An other way to launch wizards is through the :menuselection:`Action` menu of
|
||||
a tree or form view. This is done through the ``binding_model_id`` field of the
|
||||
a list or form view. This is done through the ``binding_model_id`` field of the
|
||||
action. Setting this field will make the action appear on the views of the model
|
||||
the action is "bound" to.
|
||||
|
||||
@@ -1282,7 +1282,7 @@ A report is a combination two elements:
|
||||
|
||||
Because it largerly a standard action, as with :ref:`howto/module/wizard`
|
||||
it is generally useful to add the report as a *contextual item* on the
|
||||
tree and / or form views of the model being reported on via the
|
||||
list and / or form views of the model being reported on via the
|
||||
``binding_model_id`` field.
|
||||
|
||||
Here we are also using ``binding_type`` in order for the report to be in
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -698,10 +698,10 @@ let's also add views so we can see and edit a course's teacher:
|
||||
<field name="name">Academy courses: list</field>
|
||||
<field name="model">academy.courses</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Courses">
|
||||
<list string="Courses">
|
||||
<field name="name"/>
|
||||
<field name="teacher_id"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
<record id="academy_course_form" model="ir.ui.view">
|
||||
@@ -761,9 +761,9 @@ model:
|
||||
<field name="name"/>
|
||||
<field name="biography"/>
|
||||
<field name="course_ids">
|
||||
<tree Sstring="Courses" editable="bottom">
|
||||
<list string="Courses" editable="bottom">
|
||||
<field name="name"/>
|
||||
</tree>
|
||||
</list>
|
||||
</field>
|
||||
</sheet>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user