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:
- .cache/pip/http
before_script:
- pip install sphinx-lint
- pip install sphinx-lint rstcheck[sphinx]
script:
- cd "${PACKAGE}"
- python -m sphinx -T -E -W -n -b html ${DOC_DIR} _build/html
- python -m sphinxlint ${DOC_DIR}
- rstcheck --recursive ${DOC_DIR}
- |
if [ "${CHECK_LINK}" ]; then
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`_.
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/
+2 -2
View File
@@ -15,6 +15,6 @@ updates `Currencies <model-currency.currency>`.
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
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
.. _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
`Stock Moves <model-stock.move>`.
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>`
from a supplier `Location <model-stock.location>` to the appropriate storage
location.
These stock moves must have their unit prices set to their product's cost
price.
.. |Inventory & Stock --> Moves| replace:: :menuselection:`Inventory & Stock --> Moves`
__ https://demo.tryton.org/model/stock.move
.. note::
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:
.. rstcheck: ignore-next-code-block
.. code-block:: python
Model.default_<field name>()
+17 -15
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`_
Within Tryton the model, the report is based on, can be found by opening the
menu item:
menu item::
|Administration --> Models --> Models|__
@@ -130,7 +130,7 @@ menu item:
__ https://demo.tryton.org/model/ir.model
Furthermore in Tryton the fields for that model can be found by opening the
menu item:
menu item::
|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.
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|__
@@ -214,18 +214,20 @@ Then you must create your new sale report:
.. code-block:: xml
<record model="ir.action.report" id="report_sale">
<field name="name">Sale</field>
<field name="report_name">sale.sale</field>
<field name="model">sale.sale</field>
<field name="report">my_module/sale.odt</field>
<field name="template_extension">odt</field>
</record>
<record model="ir.action.keyword" id="report_sale_keyword">
<field name="keyword">form_print</field>
<field name="model">sale.sale,-1</field>
<field name="action" ref="report_sale"/>
</record>
<data>
<record model="ir.action.report" id="report_sale">
<field name="name">Sale</field>
<field name="report_name">sale.sale</field>
<field name="model">sale.sale</field>
<field name="report">my_module/sale.odt</field>
<field name="template_extension">odt</field>
</record>
<record model="ir.action.keyword" id="report_sale_keyword">
<field name="keyword">form_print</field>
<field name="model">sale.sale,-1</field>
<field name="action" ref="report_sale"/>
</record>
</data>
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:
.. code-block::
.. code-block:: text
<for each="opportunity in records">
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():
...
Pool.register(
...
...,
opportunity.OpportunityMonthly,
module='opportunity', type_='model')
+8 -8
View File
@@ -71,14 +71,14 @@ Now we can define the :class:`~trytond.wizard.Wizard` with a ``start``
...
class Opportunity(...):
...
@classmethod
@Workflow.transition('converted')
def convert(cls, opportunities, end_date=None):
pool = Pool()
Date = pool.get('ir.date')
cls.write(opportunities, {
'end_date': end_date or Date.today(),
})
@classmethod
@Workflow.transition('converted')
def convert(cls, opportunities, end_date=None):
pool = Pool()
Date = pool.get('ir.date')
cls.write(opportunities, {
'end_date': end_date or Date.today(),
})
...
class Convert(Wizard):
"Convert Opportunities"