From 86e52478820d4762c3b3ddb8930c32591e693647 Mon Sep 17 00:00:00 2001 From: luvi Date: Fri, 26 Nov 2021 13:08:41 +0100 Subject: [PATCH] [WIP] developer: adding fields documentation This commit adds the following documentation: - ProgressBarField --- .../developer/reference/frontend/fields.rst | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/content/developer/reference/frontend/fields.rst b/content/developer/reference/frontend/fields.rst index eb6620ef4..9b5d5e165 100644 --- a/content/developer/reference/frontend/fields.rst +++ b/content/developer/reference/frontend/fields.rst @@ -164,6 +164,10 @@ Reference List - `priority` - `selection` - description... + * - :ref:`ProgressBarField ` + - `priority` + - `integer`, `float` + - display a progress bar * - :ref:`RadioField ` - `radio` - `many2one`, `selection` @@ -384,6 +388,51 @@ PriorityField - Technical name: `priority` - Supported types: `selection` +.. _frontend/fields/progress_bar_field: + +ProgressBarField +---------------- + +- Location: `@web/fields/progress_bar_field` +- Technical name: `priority` +- Supported types: `integer`, `float` + +The `ProgressBarField` component indicates a progress with a bar. It is a more visual way to +indicate a form of progression. The progress value can be displayed in two ways, depending +if a maximum value is set explicitly or not. In the first case, a ratio is shown. Otherwise, +a percentage is shown instead. + +The main entry point to edit the value is the `editable` option. If you use a percentage, +you will edit the value and see the changes directly on the left progress bar. +But if you use a ratio (with a maximum value), you will edit the values following the +specific options that were given. By default, you will only edit the current value. But if +any of the specific options `edit_max_value` and/or the `edit_current_value` are set, then +you will only be able to edit those fields. + +It supports the following options: + +.. list-table:: + :widths: 20 20 60 + :header-rows: 1 + + * - Name + - Type + - Description + * - `editable` + - `boolean` + - optional. set if the value is editable + * - `edit_current_value` + - `boolean` + - optional. set if the current value is editable + * - `edit_max_value` + - `boolean` + - optional. set if the maximum value is editable + * - `current_value` + - `integer`, `float` + - required. this is the current value of the progress from the field that is present in the view + * - `max_value` + - `integer`, `float` + - optional. this value is used to set a maximum value from the field that is present in the view .. _frontend/fields/radio_field: