Update documentation of infrastructure

Co-authored-by: David Harper <dave@libateq.org>
This commit is contained in:
Cédric KrierandDavid Harper committed 2024-08-07 23:24:57 +02:00
1 parent a080a11b3e
commit 67bfcde06f
48 files changed
+1250 -90

No files matched your search

@@ -32,8 +32,8 @@ following class method is added in :file:`opportunity.py` file:
Call other model methods
------------------------
In the previous example we called the ``today`` method of the ``ir.date`` model
from the :class:`~trytond.pool.Pool` instance.
In the previous example we called the ``today`` method of the `Date
<model-ir.date>` model from the :class:`~trytond.pool.Pool` instance.
The :attr:`~trytond.model.Model.__name__` value is used to get the class.
It is very important to get the class from the pool instead of using a normal
Python import, because the pool ensures that all of the extensions are applied
+2 -2
View File
@@ -43,8 +43,8 @@ Extend the Party view
Now that we added a new field to the ``party.party``
:class:`~trytond.model.Model`, we can also add it the form view.
This is done by adding a ``ir.ui.view`` record that inherit the party form view
of the ``party`` module.
This is done by adding a `View <model-ir.ui.view>` record that inherit the
party form view of the ``party`` module.
Here is the content of the :file:`party.xml` file:
.. code-block:: xml
+7 -7
View File
@@ -28,8 +28,8 @@ And we register it in the :class:`~trytond.pool.Pool` as type ``report`` in
module='opportunity', type_='report')
Now we have to create a ``ir.action.report`` and ``ir.action.keyword`` in
:file:`opportunity.xml`:
Now we have to create a `Report <model-ir.action.report>` and `Action Keyword
<model-ir.action>` in :file:`opportunity.xml`:
.. code-block:: xml
@@ -51,8 +51,8 @@ Now we have to create a ``ir.action.report`` and ``ir.action.keyword`` in
</data>
</tryton>
The ``ir.action.report`` links the ``trytond.report.Report`` with the
:class:`~trytond.model.Model`.
The `Report <model-ir.action.report>` links the :class:`~trytond.report.Report`
with the :class:`~trytond.model.Model`.
``name``
The string that is shown on the menu.
@@ -65,9 +65,9 @@ The ``ir.action.report`` links the ``trytond.report.Report`` with the
``template_extension``
The template format.
And like for the :ref:`wizard <tutorial-module-wizard>`, the
``ir.action.keyword`` makes the ``trytond.report.Report`` available as action
to any ``training.opportunity``.
And like for the :ref:`wizard <tutorial-module-wizard>`, the `Action Keyword
<model-ir.action>` makes the :class:`~trytond.report.Report` available as
action to any ``training.opportunity``.
Finally we create the OpenDocument_ template as :file:`opportunity.fodt` using
LibreOffice_.
+2 -2
View File
@@ -126,8 +126,8 @@ Now we have to declare the XML data file in the :file:`tryton.cfg` file:
Create menu entry
-----------------
In order to show our models on the user menu we need an
``ir.action.act_window`` and a menu entry.
In order to show our models on the user menu we need an `Window Action
<model-ir.action.act_window>` and a menu entry.
An action window is used to relate one or more views, usually a list and a form
view.
+7 -6
View File
@@ -110,8 +110,8 @@ And we register it in the :class:`~trytond.pool.Pool` as type ``wizard`` in
opportunity.Convert,
module='opportunity', type_='wizard')
Finally we just need to create a ``ir.action.wizard`` and ``ir.action.keyword``
in :file:`opportunity.xml`:
Finally we just need to create a `Wizard <model-ir.action.wizard>` and an
`Action Keyword <model-ir.action>` in :file:`opportunity.xml`:
.. code-block:: xml
@@ -131,8 +131,8 @@ in :file:`opportunity.xml`:
</data>
</tryton>
The ``ir.action.wizard`` links the :class:`~trytond.wizard.Wizard` with the
:class:`~trytond.model.Model`.
The `Wizard <model-ir.action.wizard>` links the :class:`~trytond.wizard.Wizard`
with the :class:`~trytond.model.Model`.
``name``
The string that is shown on the menu.
@@ -141,8 +141,9 @@ The ``ir.action.wizard`` links the :class:`~trytond.wizard.Wizard` with the
``model``
The name of the :class:`~trytond.model.Model`.
And the ``ir.action.keyword`` makes the :class:`~trytond.wizard.Wizard`
available as action to any ``training.opportunity``.
And the `Action Keyword <model-ir.action>` makes the
:class:`~trytond.wizard.Wizard` available as action to any
``training.opportunity``.
``keyword``
The type of `keyword <topics-actions>`.
+2 -2
View File
@@ -98,8 +98,8 @@ dictionary and decorate the transition method with the
def lost(cls, opportunities):
...
Every button must also be recorded in ``ir.model.button`` to define its label
(and also the :ref:`access right <topics-access_rights>`).
Every button must also be recorded as a `Model Button <model-ir.model.button>` to
define its label (and also the :ref:`access right <topics-access_rights>`).
We must add to the ``opportunity.xml`` file:
.. code-block:: xml