[IMP] views: setting view
This commit, add the documentation of the new DSL created exclusively for the settings. closes odoo/documentation#3092 Task-id: 3081367 Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit is contained in:
parent
339b5dbfb6
commit
d0ae1cbce0
@ -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
|
||||
|
||||
<app string="CRM" name="crm">
|
||||
...
|
||||
</app>
|
||||
|
||||
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
|
||||
|
||||
<block title="Title of group Bar">
|
||||
...
|
||||
</block>
|
||||
|
||||
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
|
||||
|
||||
<setting string="this is bar">
|
||||
<field name="bar"/>
|
||||
...More elements
|
||||
</setting>
|
||||
|
||||
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/<server_version>``,
|
||||
so it's not necessary to hard-code the server version on the arch anymore.
|
||||
|
||||
.. example::
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<app string="CRM" name="crm">
|
||||
<setting type="header" string="Foo">
|
||||
<field name="foo" title="Foo?."/>
|
||||
<button name="nameAction" type="object" string="Button"/>
|
||||
</setting>
|
||||
<block title="Title of group Bar">
|
||||
<setting help="this is bar" documentation="/applications/technical/web/settings/this_is_a_test.html">
|
||||
<field name="bar"/>
|
||||
</setting>
|
||||
<setting string="This is Big BAR" company_specific="1">
|
||||
<field name="bar"/>
|
||||
</setting>
|
||||
</block>
|
||||
<block title="Title of group Foo">
|
||||
<setting string="Personalize setting" help="this is full personalize setting">
|
||||
<div>This is a different setting</div>
|
||||
</setting>
|
||||
</block>
|
||||
</app>
|
||||
|
||||
.. _reference/views/gantt:
|
||||
|
||||
Gantt
|
||||
|
Loading…
Reference in New Issue
Block a user