diff --git a/content/developer/reference/backend/views.rst b/content/developer/reference/backend/views.rst index 67716d87c..b0e665ee0 100644 --- a/content/developer/reference/backend/views.rst +++ b/content/developer/reference/backend/views.rst @@ -1014,6 +1014,124 @@ Generic structure .. todo:: widgets? +Settings Form View +------------------ + +The settings form view is a customization of the form view. It's used to centralize all the settings +of Odoo. + +This view differs from a generic form view because it has a search bar, a sidebar and accepts 3 +additional tags: ``app``, ``block`` and ``setting``. + +.. rst-class:: o-definition-list + +``app`` + The ``app`` tag is used to declare the application on the settings view. It creates an entry with + its logo on the sidebar of the view. It also acts as delimiter when searching. + + Syntax: + + .. code-block:: xml + + + ... + + + Parameters: + + .. rst-class:: o-definition-list + + ``string`` + The "display" name of the application. + ``name`` + The technical name of the application (the name of the module). + ``logo`` (optional) + The relative path to the logo. If not set, the logo is created using the ``name`` parameter : ``/{name}/static/description/icon.png``. + +``block`` + The ``block`` tag is used to declare a group of settings. This group can have a title and a description/help. + + Syntax: + + .. code-block:: xml + + + ... + + + Parameters: + + .. rst-class:: o-definition-list + + ``title`` (optional) + The title of the block of settings, you can perform research on its text. + ``help`` (optional) + The description/help of the block of settings, you can perform research on its text. + +``setting`` + The ``setting`` tag is used to declare the setting itself. The first field in the setting is + used as the main field (optional). This field is placed on the left panel (if it's a boolean field) + or on the top of the right panel (otherwise). The field is also used to create the setting label + if a ``string`` is not defined. The ``setting`` tag can also contain more elements (e.g. html), + all of these elements are rendered in the right panel. + + Syntax: + + .. code-block:: xml + + + + ...More elements + + + Parameters: + + .. rst-class:: o-definition-list + + ``type`` (optional) + By default, a setting is visually separated on two panels (left and right), and is used to + edit a given field. By defining ``type='header'``, a special kind of setting is rendered + instead. This setting is used to modify the scope of the other settings. For example, on the + website application, this setting is used to indicate to which website the other settings + apply. The header setting is visually represented as a yellow banner on the top of the screen. + ``string`` (optional) + The text used as label of the setting. If it's not defined, the first field is used as label. + ``title`` (optional) + The text used as tooltip. + ``help`` (optional) + The help/description of the setting. This text is displayed just below the setting label (with classname ``text-muted``). + ``company_dependent`` (optional) + If this attribute is set to "1" an icon is displayed next to the setting label to explicit + that this setting is company-specific. + ``documentation`` (optional) + If this attribute is set, an icon is added next to the setting label, this icon is a link to the documentation. + Note that you can use relative or absolute path. The relative path is relative to ``https://www.odoo.com/documentation/``, + so it's not necessary to hard-code the server version on the arch anymore. + +.. example:: + + .. code-block:: xml + + + + +