Add rstcheck
This commit is contained in:
+2
-1
@@ -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;
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[rstcheck]
|
||||||
|
ignore_directives = include
|
||||||
|
ignore_messages = (Hyperlink target .* is not referenced)|(Duplicate implicit target name:.*)
|
||||||
@@ -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/
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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>()
|
||||||
|
|||||||
@@ -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,18 +214,20 @@ Then you must create your new sale report:
|
|||||||
|
|
||||||
.. code-block:: xml
|
.. code-block:: xml
|
||||||
|
|
||||||
<record model="ir.action.report" id="report_sale">
|
<data>
|
||||||
<field name="name">Sale</field>
|
<record model="ir.action.report" id="report_sale">
|
||||||
<field name="report_name">sale.sale</field>
|
<field name="name">Sale</field>
|
||||||
<field name="model">sale.sale</field>
|
<field name="report_name">sale.sale</field>
|
||||||
<field name="report">my_module/sale.odt</field>
|
<field name="model">sale.sale</field>
|
||||||
<field name="template_extension">odt</field>
|
<field name="report">my_module/sale.odt</field>
|
||||||
</record>
|
<field name="template_extension">odt</field>
|
||||||
<record model="ir.action.keyword" id="report_sale_keyword">
|
</record>
|
||||||
<field name="keyword">form_print</field>
|
<record model="ir.action.keyword" id="report_sale_keyword">
|
||||||
<field name="model">sale.sale,-1</field>
|
<field name="keyword">form_print</field>
|
||||||
<field name="action" ref="report_sale"/>
|
<field name="model">sale.sale,-1</field>
|
||||||
</record>
|
<field name="action" ref="report_sale"/>
|
||||||
|
</record>
|
||||||
|
</data>
|
||||||
|
|
||||||
Passing custom values to a report
|
Passing custom values to a report
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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')
|
||||||
|
|
||||||
|
|||||||
@@ -71,14 +71,14 @@ Now we can define the :class:`~trytond.wizard.Wizard` with a ``start``
|
|||||||
...
|
...
|
||||||
class Opportunity(...):
|
class Opportunity(...):
|
||||||
...
|
...
|
||||||
@classmethod
|
@classmethod
|
||||||
@Workflow.transition('converted')
|
@Workflow.transition('converted')
|
||||||
def convert(cls, opportunities, end_date=None):
|
def convert(cls, opportunities, end_date=None):
|
||||||
pool = Pool()
|
pool = Pool()
|
||||||
Date = pool.get('ir.date')
|
Date = pool.get('ir.date')
|
||||||
cls.write(opportunities, {
|
cls.write(opportunities, {
|
||||||
'end_date': end_date or Date.today(),
|
'end_date': end_date or Date.today(),
|
||||||
})
|
})
|
||||||
...
|
...
|
||||||
class Convert(Wizard):
|
class Convert(Wizard):
|
||||||
"Convert Opportunities"
|
"Convert Opportunities"
|
||||||
|
|||||||
Reference in New Issue
Block a user