[WIP] more documentation on fields
This commit brings more documentation for some fields: - PdfViewerField - PercentPieField
This commit is contained in:
parent
b687f02571
commit
0d70247612
@ -162,8 +162,12 @@ Reference List
|
|||||||
- display a progress bar
|
- display a progress bar
|
||||||
* - :ref:`PercentageField <frontend/fields/percentage_field>`
|
* - :ref:`PercentageField <frontend/fields/percentage_field>`
|
||||||
- `text`
|
- `text`
|
||||||
- `float`
|
- `integer`, `float`
|
||||||
- display percentages
|
- display percentages
|
||||||
|
* - :ref:`PercentPieField <frontend/fields/percent_pie_field>`
|
||||||
|
- `text`
|
||||||
|
- `integer`, `float`
|
||||||
|
- display a progress using a pie
|
||||||
* - :ref:`PhoneField <frontend/fields/phone_field>`
|
* - :ref:`PhoneField <frontend/fields/phone_field>`
|
||||||
- `text`
|
- `text`
|
||||||
- `char`, `integer`
|
- `char`, `integer`
|
||||||
@ -401,30 +405,28 @@ Many2OneField
|
|||||||
- Supported types: `many2one`
|
- Supported types: `many2one`
|
||||||
|
|
||||||
|
|
||||||
.. _frontend/fields/pdf_viewer:
|
.. _frontend/fields/pdf_viewer_field:
|
||||||
|
|
||||||
PdfViewerField
|
PdfViewerField
|
||||||
-----------
|
--------------
|
||||||
|
|
||||||
- Location: `@web/fields/pdf_viewer_field`
|
- Location: `@web/fields/pdf_viewer_field`
|
||||||
- Technical name: `pdf_viewer`
|
- Technical name: `pdf_viewer`
|
||||||
- Supported types: `binary`
|
- 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:
|
The following example will display the third page by default once the field is shown:
|
||||||
|
|
||||||
.. list-table::
|
|
||||||
:widths: 20 20 60
|
|
||||||
:header-rows: 1
|
|
||||||
|
|
||||||
* - Name
|
|
||||||
- Type
|
|
||||||
- Description
|
|
||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<field name="my_field" widget="pdf_viewer" filename="Your document" options="{'accepted_file_extensions': '.dat,.bin'}" />
|
<record>
|
||||||
|
<field name="my_pdf_page">3</field>
|
||||||
|
<field name="my_pdf" widget="pdf_viewer" filename="Your PDF" />
|
||||||
|
</record>
|
||||||
|
|
||||||
|
|
||||||
.. _frontend/fields/percentage_field:
|
.. _frontend/fields/percentage_field:
|
||||||
@ -434,7 +436,7 @@ PercentageField
|
|||||||
|
|
||||||
- Location: `@web/fields/percentage_field`
|
- Location: `@web/fields/percentage_field`
|
||||||
- Technical name: `percentage`
|
- Technical name: `percentage`
|
||||||
- Supported types: `float`
|
- Supported types: `integer`, `float`
|
||||||
|
|
||||||
The `PercentageField` component represents a percentage. To use the field, you must give a
|
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
|
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.
|
|||||||
<field name="my_field" widget="percentage" />
|
<field name="my_field" widget="percentage" />
|
||||||
|
|
||||||
|
|
||||||
|
.. _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
|
||||||
|
|
||||||
|
<field name="my_field" widget="percentpie" />
|
||||||
|
|
||||||
|
|
||||||
.. _frontend/fields/phone_field:
|
.. _frontend/fields/phone_field:
|
||||||
|
|
||||||
PhoneField
|
PhoneField
|
||||||
|
Loading…
Reference in New Issue
Block a user