Add rstcheck

This commit is contained in:
Cédric Krier
2023-03-15 16:33:19 +01:00
parent ac4d4a7fbb
commit b719d8aed1
11 changed files with 39 additions and 36 deletions
+2 -1
View File
@@ -57,11 +57,12 @@ documentation:
paths: paths:
- .cache/pip/http - .cache/pip/http
before_script: before_script:
- pip install sphinx-lint - pip install sphinx-lint rstcheck[sphinx]
script: script:
- cd "${PACKAGE}" - cd "${PACKAGE}"
- python -m sphinx -T -E -W -n -b html ${DOC_DIR} _build/html - python -m sphinx -T -E -W -n -b html ${DOC_DIR} _build/html
- python -m sphinxlint ${DOC_DIR} - python -m sphinxlint ${DOC_DIR}
- rstcheck --recursive ${DOC_DIR}
- | - |
if [ "${CHECK_LINK}" ]; then if [ "${CHECK_LINK}" ]; then
python -m sphinx -T -E -W -n -b linkcheck ${DOC_DIR} _build; python -m sphinx -T -E -W -n -b linkcheck ${DOC_DIR} _build;
+3
View File
@@ -0,0 +1,3 @@
[rstcheck]
ignore_directives = include
ignore_messages = (Hyperlink target .* is not referenced)|(Duplicate implicit target name:.*)
+2 -2
View File
@@ -33,8 +33,8 @@ the `Postal Codes <model-country.postal_code>` in Tryton from the `GeoNames
Database`_. Database`_.
It is run with: It is run with:
.. code-block:: bash .. code-block:: console
trytond_import_postal_codes -c trytond.conf -d <database> <two_letter_country_code> $ trytond_import_postal_codes -c trytond.conf -d <database> <two_letter_country_code>
.. _GeoNames Database: https://www.geonames.org/ .. _GeoNames Database: https://www.geonames.org/
+2 -2
View File
@@ -15,6 +15,6 @@ updates `Currencies <model-currency.currency>`.
You can run it with: You can run it with:
.. code-block:: bash .. code-block:: console
trytond_import_currencies -c trytond.conf -d <database> $ trytond_import_currencies -c trytond.conf -d <database>
+1 -2
View File
@@ -24,9 +24,8 @@ product variant is based exclusively on one product template.
A product's full code is made up from a prefix code which is defined on the A product's full code is made up from a prefix code which is defined on the
product template and a suffix code which is specified on the product variant. product template and a suffix code which is specified on the product variant.
The full product code can then be used as the product's |SKU|_. The full product code can then be used as the product's SKU_.
.. |SKU| replace:: :abbr:`SKU (Stock Keeping Unit)`
.. _SKU: https://en.wikipedia.org/wiki/Stock_keeping_unit .. _SKU: https://en.wikipedia.org/wiki/Stock_keeping_unit
.. _model-product.template: .. _model-product.template:
+1 -4
View File
@@ -45,16 +45,13 @@ you must enter this initial stock in the correct way.
The right way of doing this is to create a set of individual The right way of doing this is to create a set of individual
`Stock Moves <model-stock.move>`. `Stock Moves <model-stock.move>`.
These moves can be created in the view that is opened from the These moves can be created in the view that is opened from the
|Inventory & Stock --> Moves|__ main menu item. :menuselection:`Inventory & Stock --> Moves` main menu item.
Each of the stock moves should move some stock of a `Product <concept-product>` Each of the stock moves should move some stock of a `Product <concept-product>`
from a supplier `Location <model-stock.location>` to the appropriate storage from a supplier `Location <model-stock.location>` to the appropriate storage
location. location.
These stock moves must have their unit prices set to their product's cost These stock moves must have their unit prices set to their product's cost
price. price.
.. |Inventory & Stock --> Moves| replace:: :menuselection:`Inventory & Stock --> Moves`
__ https://demo.tryton.org/model/stock.move
.. note:: .. note::
As these moves are for your initial stock they have no origin, and As these moves are for your initial stock they have no origin, and
@@ -9,6 +9,7 @@ is set with the default value if exists.
The following class method: The following class method:
.. rstcheck: ignore-next-code-block
.. code-block:: python .. code-block:: python
Model.default_<field name>() Model.default_<field name>()
+5 -3
View File
@@ -122,7 +122,7 @@ Additional objects can be passed to a report.
This is discussed below in `Passing custom values to a report`_ This is discussed below in `Passing custom values to a report`_
Within Tryton the model, the report is based on, can be found by opening the Within Tryton the model, the report is based on, can be found by opening the
menu item: menu item::
|Administration --> Models --> Models|__ |Administration --> Models --> Models|__
@@ -130,7 +130,7 @@ menu item:
__ https://demo.tryton.org/model/ir.model __ https://demo.tryton.org/model/ir.model
Furthermore in Tryton the fields for that model can be found by opening the Furthermore in Tryton the fields for that model can be found by opening the
menu item: menu item::
|Administration --> Models --> Models --> Fields|__ |Administration --> Models --> Models --> Fields|__
@@ -142,7 +142,7 @@ Creating a simple report template for a model from the client
------------------------------------------------------------- -------------------------------------------------------------
Once you have created a report template it has to be uploaded to the server. Once you have created a report template it has to be uploaded to the server.
This can be done by creating a new record by opening the menu item: This can be done by creating a new record by opening the menu item::
|Administration --> User Interface --> Actions --> Reports|__ |Administration --> User Interface --> Actions --> Reports|__
@@ -214,6 +214,7 @@ Then you must create your new sale report:
.. code-block:: xml .. code-block:: xml
<data>
<record model="ir.action.report" id="report_sale"> <record model="ir.action.report" id="report_sale">
<field name="name">Sale</field> <field name="name">Sale</field>
<field name="report_name">sale.sale</field> <field name="report_name">sale.sale</field>
@@ -226,6 +227,7 @@ Then you must create your new sale report:
<field name="model">sale.sale,-1</field> <field name="model">sale.sale,-1</field>
<field name="action" ref="report_sale"/> <field name="action" ref="report_sale"/>
</record> </record>
</data>
Passing custom values to a report Passing custom values to a report
--------------------------------- ---------------------------------
+1 -1
View File
@@ -78,7 +78,7 @@ selected record instances.
Here is an example of the directives to insert in the document: Here is an example of the directives to insert in the document:
.. code-block:: .. code-block:: text
<for each="opportunity in records"> <for each="opportunity in records">
Opportunity: <opportunity.rec_name> Opportunity: <opportunity.rec_name>
+1 -1
View File
@@ -74,7 +74,7 @@ the :class:`~trytond.pool.Pool` as type ``model`` in :file:`__init__.py`:
def register(): def register():
... ...
Pool.register( Pool.register(
... ...,
opportunity.OpportunityMonthly, opportunity.OpportunityMonthly,
module='opportunity', type_='model') module='opportunity', type_='model')