[FIX] *: RST cleanup

RST cleanup to comply with the RST guidelines. This is required so we
can use "make test", as there are currently hundreds of errors. For now,
it is unusable because of the oldest code in this repo.

closes odoo/documentation#3567

Signed-off-by: Castillo Jonathan (jcs) <jcs@odoo.com>
This commit is contained in:
Jonathan Castillo (jcs)
2023-02-13 15:50:13 +00:00
parent 1591e1f087
commit 643834ced1
59 changed files with 834 additions and 836 deletions
@@ -30,6 +30,7 @@ Module structure
Directories
-----------
A module is organized in important directories. Those contain the business logic;
having a look at them should make you understand the purpose of the module.
@@ -242,6 +243,7 @@ XML files
Format
------
To declare a record in XML, the **record** notation (using *<record>*) is recommended:
- Place ``id`` attribute before ``model``
@@ -408,6 +410,7 @@ source code tries to respect Python standard, but some of them can be ignored.
Imports
-------
The imports are ordered as
#. External libraries (one per line sorted and split in python stdlib)
@@ -586,9 +589,9 @@ Programming in Odoo
- As in python, use ``filtered``, ``mapped``, ``sorted``, ... methods to
ease code reading and performance.
Make your method work in batch
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When adding a function, make sure it can process multiple records by iterating
on self to treat each record.
@@ -614,6 +617,7 @@ is recommended to use ``read_group`` method, to compute all value in only one re
Propagate the context
~~~~~~~~~~~~~~~~~~~~~
The context is a ``frozendict`` that cannot be modified. To call a method with
a different context, the ``with_context`` method should be used :
@@ -636,7 +640,6 @@ choose a good name, and eventually prefix it by the name of the module to
isolate its impact. A good example are the keys of ``mail`` module :
*mail_create_nosubscribe*, *mail_notrack*, *mail_notify_user_signature*, ...
Think extendable
~~~~~~~~~~~~~~~~
@@ -680,9 +683,9 @@ the starting point of readable/maintainable code and tighter documentation.
This recommendation is also relevant for classes, files, modules and packages.
(See also http://en.wikipedia.org/wiki/Cyclomatic_complexity)
Never commit the transaction
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Odoo framework is in charge of providing the transactional context for
all RPC calls. The principle is that a new database cursor is opened at the
beginning of each RPC call, and committed when the call has returned, just
@@ -748,7 +751,6 @@ have an **explicit comment** explaining why they are absolutely necessary, why
they are indeed correct, and why they do not break the transactions. Otherwise
they can and will be removed !
Use translation method correctly
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -837,7 +839,6 @@ In general in Odoo, when manipulating strings, prefer ``%`` over ``.format()``
of position (when multiple variables have to be replaced). This makes the
translation easier for the community translators.
Symbols and Conventions
-----------------------
@@ -951,7 +952,7 @@ Javascript and CSS
==================
Static files organization
--------------------------
-------------------------
Odoo addons have some conventions on how to structure various files. We explain
here in more details how web assets are supposed to be organized.
@@ -1,6 +1,6 @@
=================
==============
Git guidelines
=================
==============
Configure your git
------------------