[FIX] core; base: lots of docstrings

* add configuration for `flake8[flake8-rst-docstring]`
* enable docstring-related checks
* fix invalid docstrings in odoo's core & `base`
* fix a few more bits (mostly missing or incorrect `:param:` info
  fields) are out of scope for the lint but my editor catches

closes odoo/odoo#74604

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
This commit is contained in:
Xavier Morel
2021-12-09 14:36:58 +00:00
parent bf35fd86d0
commit bdc9d9d369
31 changed files with 529 additions and 405 deletions
+4
View File
@@ -123,11 +123,15 @@ def force_demo(cr):
def load_module_graph(cr, graph, status=None, perform_checks=True,
skip_modules=None, report=None, models_to_check=None):
"""Migrates+Updates or Installs all module nodes from ``graph``
:param cr:
:param graph: graph of module nodes to load
:param status: deprecated parameter, unused, left to avoid changing signature in 8.0
:param perform_checks: whether module descriptors should be checked for validity (prints warnings
for same cases)
:param skip_modules: optional list of module names (packages) which have previously been loaded and can be skipped
:param report:
:param set models_to_check:
:return: list of modules that were installed or updated
"""
if models_to_check is None:
+11 -8
View File
@@ -27,18 +27,21 @@ def load_script(path, module_name):
class MigrationManager(object):
"""
This class manage the migration of modules
Migrations files must be python files containing a `migrate(cr, installed_version)`
""" Manages the migration of modules.
Migrations files must be python files containing a ``migrate(cr, installed_version)``
function. These files must respect a directory tree structure: A 'migrations' folder
which contains a folder by version. Version can be 'module' version or 'server.module'
version (in this case, the files will only be processed by this version of the server).
Python file names must start by `pre-` or `post-` and will be executed, respectively,
before and after the module initialisation. `end-` scripts are run after all modules have
Python file names must start by ``pre-`` or ``post-`` and will be executed, respectively,
before and after the module initialisation. ``end-`` scripts are run after all modules have
been updated.
A special folder named `0.0.0` can contain scripts that will be run on any version change.
In `pre` stage, `0.0.0` scripts are run first, while in `post` and `end`, they are run last.
Example:
A special folder named ``0.0.0`` can contain scripts that will be run on any version change.
In `pre` stage, ``0.0.0`` scripts are run first, while in ``post`` and ``end``, they are run last.
Example::
<moduledir>
`-- migrations
|-- 1.0