[ADD] doc: new documentation, with training tutorials, and new scaffolding
[odoo/odoo.git] / doc / reference / module.rst
1 =======
2 Modules
3 =======
4
5 .. _reference/module/manifest:
6
7 Manifest
8 ========
9
10 The manifest file serves to both declare a python package as an Odoo module,
11 and to specify a number of module metadata.
12
13 It is a file called ``__openerp__.py`` and contains a single Python
14 dictionary, each dictionary key specifying a module metadatum.
15
16 Available manifest fields are:
17
18 ``name`` (``str``, required)
19     the human-readable name of the module
20 ``version`` (``str``)
21     this module's version, should follow `semantic versioning`_ rules
22 ``description`` (``str``)
23     extended description for the module, in reStructuredText
24 ``author`` (``str``)
25     name of the module author
26 ``website`` (``str``)
27     website URL for the module author
28 ``license`` (``str``, defaults: ``AGPL-3``)
29     distribution license for the module
30 ``category`` (``str``, default: ``Uncategorized``)
31     classification category within Odoo, rough business domain for the module.
32
33     Although using `existing categories`_ is recommended, the field is
34     freeform and unknown categories are created on-the-fly. Category
35     hierarchies can be created using the separator ``/`` e.g. ``Foo / Bar``
36     will create a category ``Foo``, a category ``Bar`` as child category of
37     ``Foo``, and will set ``Bar`` as the module's category.
38 ``depends`` (``list(str)``)
39     Odoo modules which must be loaded before this one, either because this
40     module uses features they create or because it alters resources they
41     define.
42
43     When a module is installed, all of its dependencies are installed before
44     it. Likewise during modules loading.
45 ``data`` (``list(str)``)
46     List of data files which must always be installed or updated with the
47     module. A list of paths from the module root directory
48 ``demo`` (``list(str)``)
49     List of data files which are only installed or updated in *demonstration
50     mode*
51 ``auto_install`` (``bool``, default: ``False``)
52     If ``True``, this module will automatically be installed if all of its
53     dependencies are installed.
54
55     It is generally used for "link modules" implementing synergic integration
56     between two otherwise independent modules.
57
58     For instance ``sale_crm`` depends on both ``sale`` and ``crm`` and is set
59     to ``auto_install``. When both ``sale`` and ``crm`` are installed, it
60     automatically adds CRM campaigns tracking to sale orders without either
61     ``sale`` or ``crm`` being aware of one another
62
63 .. _reference/module/lifecycle:
64
65 Lifecycle
66 =========
67
68 .. _reference/module/lifecycle/install:
69
70 Install
71 -------
72
73 .. _reference/module/lifecycle/update:
74
75 Update
76 ------
77
78 .. _semantic versioning: http://semver.org
79 .. _existing categories:
80      https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml