From 5fb2d7c1c231a191cceb491bda996eb534def9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Tue, 23 Nov 2021 09:51:25 +0100 Subject: [PATCH] [ADD] add page on fields (wip) --- content/developer/reference/frontend.rst | 1 + .../developer/reference/frontend/fields.rst | 80 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 content/developer/reference/frontend/fields.rst diff --git a/content/developer/reference/frontend.rst b/content/developer/reference/frontend.rst index 814699e2c..af11e0b50 100644 --- a/content/developer/reference/frontend.rst +++ b/content/developer/reference/frontend.rst @@ -14,6 +14,7 @@ Frontend frontend/registries frontend/services frontend/hooks + frontend/fields frontend/patching_code frontend/javascript_cheatsheet frontend/javascript_reference diff --git a/content/developer/reference/frontend/fields.rst b/content/developer/reference/frontend/fields.rst new file mode 100644 index 000000000..1d25400c6 --- /dev/null +++ b/content/developer/reference/frontend/fields.rst @@ -0,0 +1,80 @@ + +====== +Fields +====== + +In Odoo, the word *field* is mostly used to denote a part of a model, usually +represented by a column in a database. Fields are represented by components in +the user interface (mostly in the form and list view). In this page, we document +how these field components work and how to use them. + +How to define a field +===================== + +TODO + +How to use a field +================== + +TODO + +Reference List +============== + +.. list-table:: + :widths: 15 20 20 45 + :header-rows: 1 + + * - Name + - Technical name + - Type + - Short Description + * - :ref:`FieldText ` + - `text` + - `char` + - display text values + * - :ref:`OtherField ` + - `other_name` + - `text`, `many2one` + - represents some values + +.. _frontend/fields/field_text: + +FieldText +--------- + +- Location: `@web/fields/text_field` +- Technical name: `text` +- Supported types: `char` + +The `FieldText` component represents a textual value. It is the default field +for all fields of type `char`. + +.. _frontend/fields/other_field: + +Other Field +----------- + +- Location: `@web/fields/other_field` +- Technical name: `blabla` +- Supported types: `char`, `many2one` + +The `OtherField` component represents ... + +.. code-block:: xml + + + +It supports the following options: + + +.. list-table:: + :widths: 20 20 60 + :header-rows: 1 + + * - Name + - Type + - Description + * - `horizontal` + - `boolean` + - optional. if `true`, radio buttons will be displayed horizontally (default=`false`)