Fix typos and improve wording in modules topic documentation

This commit is contained in:
Hartmut Goebel committed 2025-02-02 02:12:48 +01:00
1 parent 1a2adb337a
commit 0dadb2a7d1
1 file changed
+22 -14
+22 -14
View File
@@ -5,7 +5,7 @@ Modules
=======
The modules of Tryton extend the functionality of the platform.
The server comes by default with only a basic functionality included in these
The server comes by default with only basic functionality included in these
modules: ``ir``, ``res``.
Module Structure
@@ -26,20 +26,25 @@ files:
------------------------
It is the Python :file:`__init__.py` to define a module.
It must contains a method named ``register()`` that must register to the pool
all the objects of the module.
It must contain a method named ``register()`` that must register all the
objects of the module in the :class:`~trytond.pool.Pool`.
.. _topics-modules-tryton-cfg:
:file:`tryton.cfg` file
-----------------------
It is a configuration file using the format of `ConfigParser`_ that must
contain ``tryton`` section with this following keys:
This is a configuration file that uses the `ConfigParser`_ format and must
contain a ``[tryton]`` section with the following keys:
``version``
The version number of the module.
.. note::
When using the ``setup.py`` generated by the cookiecutter template, the
major and minor part of this version (X.Y.*) must match the version of the
Tryton server the module is for.
``depends``
A one per line list of modules on which this module depends.
@@ -77,9 +82,11 @@ The Python files define the models for the modules.
XML Files
=========
The XML files define data that are inserted into the database on activation.
The XML files define the data that is inserted into the database on activation.
There is an RNC for those files stored in :file:`trytond/tryton.rnc`.
The :file:`trytond/tryton.rng` and :file:`trytond/tryton.rnc` files contain a
`RELAX NG <https://en.wikipedia.org/wiki/RELAX_NG>`_ XML schema for these files
in XML syntax and compact syntax respectively.
The following snippet gives a first idea of what an XML file looks:
@@ -125,10 +132,10 @@ The following snippet gives a first idea of what an XML file looks:
</data>
</tryton>
Here is the list of the tags:
Here is the list of valid tags:
``tryton``
The main tag of the XML
The root tag of the XML.
``data``
Define a set of data inside the file.
@@ -152,15 +159,15 @@ Here is the list of the tags:
``field``
Set the value of the field with the name defined by the attribute ``name``.
Here is the list of attributes:
Here is the list of valid attributes:
``search``
Only for relation field.
Only for relation fields.
It contains a domain which is used to search for the value to use.
The first value found will be used.
``ref``
Only for relation field.
Only for relation fields.
It contains an XML id of the relation to use as value.
It must be prefixed by the module name with an ending dot, if the record
is defined in an other module.
@@ -188,8 +195,9 @@ Here is the list of the tags:
are activated.
.. note::
Field content is considered as a string. So for fields that require
other types, it is required to use the ``eval`` attribute.
Field content is treated as a string.
So for fields that require other types, it is required to use the
``eval`` attribute.
``menuitem``
Shortcut to create `Menu <model-ir.ui.menu>` records.