From 0d70247612c1ca18261582a3596a600902d9c40e Mon Sep 17 00:00:00 2001 From: luvi Date: Fri, 24 Dec 2021 08:03:52 +0100 Subject: [PATCH] [WIP] more documentation on fields This commit brings more documentation for some fields: - PdfViewerField - PercentPieField --- .../developer/reference/frontend/fields.rst | 50 +++++++++++++------ 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/content/developer/reference/frontend/fields.rst b/content/developer/reference/frontend/fields.rst index 6213858a8..8d32a0527 100644 --- a/content/developer/reference/frontend/fields.rst +++ b/content/developer/reference/frontend/fields.rst @@ -162,8 +162,12 @@ Reference List - display a progress bar * - :ref:`PercentageField ` - `text` - - `float` + - `integer`, `float` - display percentages + * - :ref:`PercentPieField ` + - `text` + - `integer`, `float` + - display a progress using a pie * - :ref:`PhoneField ` - `text` - `char`, `integer` @@ -401,30 +405,28 @@ Many2OneField - Supported types: `many2one` -.. _frontend/fields/pdf_viewer: +.. _frontend/fields/pdf_viewer_field: PdfViewerField ------------ +-------------- - Location: `@web/fields/pdf_viewer_field` - Technical name: `pdf_viewer` - Supported types: `binary` -Todo +The PdfViewerField allows a user to upload a file in edit mode. If a file is loaded, the PDF is +visible inside the field. From the preview, the user can navigate between pages or download +the file. You can specify to which page the preview is loaded by using an other field in the +same record. To do so, the field must have the same name, followed by `_page`. -It supports the following options: - -.. list-table:: - :widths: 20 20 60 - :header-rows: 1 - - * - Name - - Type - - Description +The following example will display the third page by default once the field is shown: .. code-block:: xml - + + 3 + + .. _frontend/fields/percentage_field: @@ -434,7 +436,7 @@ PercentageField - Location: `@web/fields/percentage_field` - Technical name: `percentage` -- Supported types: `float` +- Supported types: `integer`, `float` The `PercentageField` component represents a percentage. To use the field, you must give a float value. Then, the field will format and display the value to a percentage, using a single @@ -447,6 +449,24 @@ end, the value is always saved as a float value. +.. _frontend/fields/percent_pie_field: + +PercentPieField +--------------- + +- Location: `@web/fields/percent_pie_field` +- Technical name: `percentpie` +- Supported types: `integer`, `float` + +The `PercentPieField` component represents a progress using a percentage associated with a +pie. To use this field, you provide the percentage directly to the field. The PercentPie +is not editable directly. To do so, you must update the value used by the field. + +.. code-block:: xml + + + + .. _frontend/fields/phone_field: PhoneField