diff --git a/trytond/doc/topics/modules/index.rst b/trytond/doc/topics/modules/index.rst index 4a45816ddb..6eb644f62d 100644 --- a/trytond/doc/topics/modules/index.rst +++ b/trytond/doc/topics/modules/index.rst @@ -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 `_ 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: -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 ` records.