[IMP] Studio: add a data table using the report editor

task-3698568

closes odoo/documentation#7621

X-original-commit: 281137ccfb
Signed-off-by: Audrey Vandromme (auva) <auva@odoo.com>
This commit is contained in:
“Audrey 2024-01-25 17:00:17 +01:00
parent 0ab45d7ce0
commit 5db4cbd1f6
3 changed files with 29 additions and 0 deletions

View File

@ -232,6 +232,35 @@ fields if needed. Then, specify the default value and press `Enter`.
.. image:: pdf_reports/powerbox-field.png
:alt: Select a related field.
Add a data table
****************
Data tables are used to display :ref:`relational fields <studio/fields/relational-fields>`. To add
a data table, type `/`, select the :guilabel:`Dynamic Table` command, and select the relation to be
displayed in the table.
.. note::
Only relations of type `one2many` or `many2many` can be displayed as data tables.
Once the table has been added, you can add columns using the table tools. Position the cursor on top
of the column, then click the purple rectangle and select an option.
.. image:: pdf_reports/table-add-column.png
:alt: Add a column in a dynamic table.
You can then insert the :ref:`field of your choice
<studio/pdf-reports/add-field>` in the columns. The dialog box that opens shows the source object
for the field (e.g., the *Tag* model) and the list of available fields.
.. image:: pdf_reports/dynamic-table.png
:alt: List of available fields for the Tag model.
.. note::
- The default row automatically iterates over the field's content, generating a row on the report
for each field value (e.g., one row per tag). You can add static content rows above or below
the generated rows using the table tools.
- You can also add data tables by :ref:`modifying the report's XML <studio/pdf-reports/XML-editing>`.
Formatting
**********

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB