Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5742eee

Browse files
committedApr 1, 2025·
[REF] manifest
1 parent f7738a4 commit 5742eee

File tree

4 files changed

+365
-120
lines changed

4 files changed

+365
-120
lines changed
 

Diff for: ‎conf.py

+2
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@
191191

192192
# Strange html domain logic used in memento pages
193193
'html_domain',
194+
195+
'badges',
194196
]
195197

196198
if odoo_dir_in_path:

Diff for: ‎content/developer/reference/backend/module.rst

+306-120
Original file line numberDiff line numberDiff line change
@@ -27,131 +27,317 @@ dictionary, where each key specifies module metadatum.
2727
'description': """
2828
Description text
2929
""",
30-
# data files always loaded at installation
3130
'data': [
32-
'views/mymodule_view.xml',
31+
'views/module_view.xml',
3332
],
34-
# data files containing optionally loaded demonstration data
3533
'demo': [
3634
'demo/demo_data.xml',
3735
],
3836
}
3937

40-
Available manifest fields are:
41-
42-
``name`` (``str``, required)
43-
the human-readable name of the module
44-
``version`` (``str``)
45-
this module's version, should follow `semantic versioning`_ rules
46-
``description`` (``str``)
47-
extended description for the module, in reStructuredText
48-
``author`` (``str``)
49-
name of the module author
50-
``website`` (``str``)
51-
website URL for the module author
52-
``license`` (``str``, defaults: ``LGPL-3``)
53-
distribution license for the module.
54-
Possible values:
55-
56-
* `GPL-2`
57-
* `GPL-2 or any later version`
58-
* `GPL-3`
59-
* `GPL-3 or any later version`
60-
* `AGPL-3`
61-
* `LGPL-3`
62-
* `Other OSI approved licence`
63-
* `OEEL-1` (Odoo Enterprise Edition License v1.0)
64-
* `OPL-1` (Odoo Proprietary License v1.0)
65-
* `Other proprietary`
66-
67-
``category`` (``str``, default: ``Uncategorized``)
68-
classification category within Odoo, rough business domain for the module.
69-
70-
Although using `existing categories`_ is recommended, the field is
71-
freeform and unknown categories are created on-the-fly. Category
72-
hierarchies can be created using the separator ``/`` e.g. ``Foo / Bar``
73-
will create a category ``Foo``, a category ``Bar`` as child category of
74-
``Foo``, and will set ``Bar`` as the module's category.
75-
``depends`` (``list(str)``)
76-
Odoo modules which must be loaded before this one, either because this
77-
module uses features they create or because it alters resources they
78-
define.
79-
80-
When a module is installed, all of its dependencies are installed before
81-
it. Likewise dependencies are loaded before a module is loaded.
82-
83-
.. note::
84-
Module `base` is always installed in any Odoo instance.
85-
But you still need to specify it as dependency to make sure your module is updated when `base` is updated.
86-
87-
``data`` (``list(str)``)
88-
List of data files which must always be installed or updated with the
89-
module. A list of paths from the module root directory
90-
``demo`` (``list(str)``)
91-
List of data files which are only installed or updated in *demonstration
92-
mode*
93-
``auto_install`` (``bool`` or ``list(str)``, default: ``False``)
94-
If ``True``, this module will automatically be installed if all of its
95-
dependencies are installed.
96-
97-
It is generally used for "link modules" implementing synergetic integration
98-
between two otherwise independent modules.
99-
100-
For instance ``sale_crm`` depends on both ``sale`` and ``crm`` and is set
101-
to ``auto_install``. When both ``sale`` and ``crm`` are installed, it
102-
automatically adds CRM campaigns tracking to sale orders without either
103-
``sale`` or ``crm`` being aware of one another.
104-
105-
If it is a list, it must contain a subset of the dependencies. This module will automatically be
106-
installed as soon as all the dependencies in the subset are installed. The remaining
107-
dependencies will be automatically installed as well. If the list is empty, this module will
108-
always be automatically installed regardless of its dependencies and these will be installed as
109-
well.
110-
111-
``external_dependencies`` (``dict(key=list(str))``)
112-
A dictionary containing python and/or binary dependencies.
113-
114-
For python dependencies, the ``python`` key must be defined for this
115-
dictionary and a list of python modules to be imported should be assigned
116-
to it.
117-
118-
For binary dependencies, the ``bin`` key must be defined for this
119-
dictionary and a list of binary executable names should be assigned to it.
120-
121-
The module won't be installed if either the python module is not installed
122-
in the host machine or the binary executable is not found within the
123-
host machine's PATH environment variable.
124-
``application`` (``bool``, default: ``False``)
125-
Whether the module should be considered as a fully-fledged application
126-
(``True``) or is just a technical module (``False``) that provides some
127-
extra functionality to an existing application module.
128-
``assets`` (``dict``)
129-
A definition of how all static files are loaded in various assets bundles.
130-
See the :ref:`assets <reference/assets>` page for more details on how to
131-
describe bundles.
132-
``installable`` (``bool`` default: ``True``)
133-
Whether a user should be able to install the module from the Web UI or not.
134-
``maintainer`` (``str``)
135-
Person or entity in charge of the maintenance of this module, by default
136-
it is assumed that the author is the maintainer.
137-
``{pre_init, post_init, uninstall}_hook`` (``str``)
138-
Hooks for module installation/uninstallation, their value should be a
139-
string representing the name of a function defined inside the module's
140-
``__init__.py``.
141-
142-
``pre_init_hook`` takes a cursor as its only argument, this function is
143-
executed prior to the module's installation.
144-
145-
``post_init_hook`` takes a cursor and a registry as its arguments, this
146-
function is executed right after the module's installation.
147-
148-
``uninstall_hook`` takes a cursor and a registry as its arguments, this
149-
function is executed after the module's uninstallation.
150-
151-
These hooks should only be used when setup/cleanup required for this module
152-
is either extremely difficult or impossible through the api.
153-
``active`` (``bool``)
154-
Deprecated. Replaced by ``auto_install``.
155-
156-
.. _semantic versioning: https://semver.org
38+
Available manifest keys:
39+
40+
.. container:: d-flex justify-content-between pb-4
41+
42+
.. container::
43+
44+
* :ref:`application <application>`
45+
* :ref:`assets <assets>`
46+
* :ref:`author <author>`
47+
* :ref:`auto_install <auto_install>`
48+
* :ref:`category <category>`
49+
* :ref:`data <data>`
50+
* :ref:`demo <demo>`
51+
52+
.. container::
53+
54+
* :ref:`depends <depends>`
55+
* :ref:`description <description>`
56+
* :ref:`external_dependencies <external_dependencies>`
57+
* :ref:`installable <installable>`
58+
* :ref:`license <license>`
59+
* :ref:`maintainer <maintainer>`
60+
* :ref:`name <name>`
61+
62+
.. container::
63+
64+
* :ref:`post_init_hook <post_init_hook>`
65+
* :ref:`pre_init_hook <pre_init_hook>`
66+
* :ref:`uninstall_hook <uninstall_hook>`
67+
* :ref:`version <version>`
68+
* :ref:`website <website>`
69+
70+
.. _application:
71+
72+
**application**
73+
74+
.. container:: ps-3 pb-3
75+
76+
:badge-primary:`bool` :badge-secondary:`default: False`
77+
78+
Specifies if the module should be considered as a fully-fledged application (``True``) or is just a technical module (``False``) that provides some extra functionality to an existing application module.
79+
80+
.. _assets:
81+
82+
**assets**
83+
84+
.. container:: ps-3 pb-3
85+
86+
:badge-primary:`dict`
87+
88+
Specifies how all static files are loaded in various assets bundles.
89+
90+
See the :ref:`assets <reference/assets>` page for more details on how to describe bundles.
91+
92+
.. _author:
93+
94+
**author**
95+
96+
.. container:: ps-3 pb-3
97+
98+
:badge-primary:`dict`
99+
100+
Specifies the person or entity that authored the module.
101+
102+
If you are an employee at Odoo, it should be ``Odoo S.A.``.
103+
104+
105+
.. _auto_install:
106+
107+
**auto_install**
108+
109+
.. container:: ps-3 pb-3
110+
111+
:badge-primary:`bool` :badge-primary:`list(str)`
112+
113+
If it is a ``bool``, it specifies if the module should be automatically installed once all of its dependencies are installed (``True``).
114+
115+
If it is a ``list(str)``, it must contain a subset of dependencies. It specifies if the module should be automatically installed once all the subset dependencies are installed and install the remaining dependencies.
116+
117+
::
118+
119+
# Once the module 'crm' is installed, this module will be automatically installed as well as
120+
# the modules 'sale', and 'web'.
121+
122+
{
123+
'depends': ['crm', 'sale', 'web'],
124+
'auto_install': ['crm'],
125+
}
126+
127+
128+
If the list of subset of dependencies is empty, the module will always be installed regardless of its dependencies and those will be installed as well.
129+
130+
::
131+
132+
# This module will always be automatically installed as well as the modules 'crm', 'sale',
133+
# and 'web'.
134+
135+
{
136+
'depends': ['crm', 'sale', 'web'],
137+
'auto_install': [],
138+
}
139+
140+
This key is generally used for bridge modules implementing synergistic integration between two otherwise independent modules.
141+
142+
For example, ``sale_crm`` depends on both ``sale`` and ``crm`` and is set to ``auto_install``. When both ``sale`` and ``crm`` are installed, it will automatically add CRM campaigns tracking to sale orders without either ``sale`` or ``crm`` being aware of one another.
143+
144+
.. _category:
145+
146+
**category**
147+
148+
.. container:: ps-3 pb-3
149+
150+
:badge-primary:`str` :badge-secondary:`default: Uncategorized`
151+
152+
Specifies the classification category (business domain) within Odoo.
153+
154+
Although using existing categories is recommended, the field is freeform and unknown categories are created on-the-fly. Category hierarchies can be created using the separator ``/`` e.g. ``Foo/Bar`` will create a category ``Foo``, a category ``Bar`` as a child category of ``Foo``, and will set ``Bar`` as the module’s category.
155+
156+
.. _data:
157+
158+
**data**
159+
160+
.. container:: ps-3 pb-3
161+
162+
:badge-primary:`list(str)`
163+
164+
Specifies the list of data files that are only installed or updated with the module.
165+
166+
The paths must be specified from the module root directory.
167+
168+
.. _demo:
169+
170+
**demo**
171+
172+
.. container:: ps-3 pb-3
173+
174+
:badge-primary:`list(str)`
175+
176+
Specifies the list of data files that are only installed or updated in *demonstration mode*.
177+
178+
.. _depends:
179+
180+
**depends**
181+
182+
.. container:: ps-3 pb-3
183+
184+
:badge-primary:`list(str)`
185+
186+
Specifies the list of modules that will be installed (or loaded) before installing (or loading) this module.
187+
188+
A module depends on another if it uses features from it or alter its resources.
189+
190+
The module base is always installed in any Odoo instance but it still needs to be specified as a dependency to make sure the module is updated when base is.
191+
192+
.. _description:
193+
194+
**description**
195+
196+
.. container:: ps-3 pb-3
197+
198+
:badge-primary:`str`
199+
200+
Specifies the extended description of the module in *reStructuredText*.
201+
202+
.. _external_dependencies:
203+
204+
**external_dependencies**
205+
206+
.. container:: ps-3 pb-3
207+
208+
:badge-primary:`dict(key=list(str))`
209+
210+
Specifies a dictionary containing python and/or binary dependencies.
211+
212+
::
213+
214+
{
215+
'external_dependencies': {
216+
'python': [...],
217+
'bin': [...]
218+
},
219+
}
220+
221+
For python dependencies, the ``python`` key must be defined for this dictionary and a list of python modules to be imported should be assigned to it.
222+
223+
For binary dependencies, the ``bin`` key must be defined for this dictionary and a list of binary executable names should be assigned to it.
224+
225+
The module won’t be installed if either the python module is not installed in the host machine or the binary executable is not found within the host machine’s PATH environment variable.
226+
227+
.. _installable:
228+
229+
**installable**
230+
231+
.. container:: ps-3 pb-3
232+
233+
:badge-primary:`bool` :badge-secondary:`default: True`
234+
235+
Specifies if the user is able to install the module from the Web User Interface (``True``).
236+
237+
.. _license:
238+
239+
**license**
240+
241+
.. container:: ps-3 pb-3
242+
243+
:badge-primary:`str` :badge-secondary:`default: LGPL-3`
244+
245+
Specifies the distribution license for the module.
246+
247+
Its value should be one of the following:
248+
249+
* ``GPL-2 or any later version``
250+
* ``GPL-3 or any later version``
251+
* ``AGPL-3``
252+
* ``LGPL-3``
253+
* ``Other OSI approved licence``
254+
* ``OEEL-1`` (Odoo Enterprise Edition License v1.0)
255+
* ``OPL-1`` (Odoo Proprietary License v1.0)
256+
* ``Other proprietary``
257+
258+
.. _maintainer:
259+
260+
**maintainer**
261+
262+
.. container:: ps-3 pb-3
263+
264+
:badge-primary:`str`
265+
266+
Specifies the person or entity in charge of the maintenance of this module.
267+
268+
By default, it is assumed that the author is also the maintainer.
269+
270+
.. _name:
271+
272+
**name**
273+
274+
.. container:: ps-3 pb-3
275+
276+
:badge-primary:`str` :badge-danger:`required`
277+
278+
Specifies the human-readable name of the module.
279+
280+
.. _post_init_hook:
281+
282+
**post_init_hook**
283+
284+
.. container:: ps-3 pb-3
285+
286+
:badge-primary:`str`
287+
288+
Specifies a function that will be executed right after the module’s installation.
289+
290+
Its value should be the name of a function defined inside the module’s ``__init__.py``.
291+
292+
This key should only be used when the setup required for this module is either extremely difficult or impossible through the api.
293+
294+
.. _pre_init_hook:
295+
296+
**pre_init_hook**
297+
298+
.. container:: ps-3 pb-3
299+
300+
:badge-primary:`str`
301+
302+
Specifies a function that will be executed right before the module’s installation.
303+
304+
Its value should be the name of a function defined inside the module’s ``__init__.py``.
305+
306+
This key should only be used when the setup required for this module is either extremely difficult or impossible through the api.
307+
308+
.. _uninstall_hook:
309+
310+
**uninstall_hook**
311+
312+
.. container:: ps-3 pb-3
313+
314+
:badge-primary:`str`
315+
316+
Specifies a function that will be executed right after the module’s uninstallation.
317+
318+
Its value should be the name of a function defined inside the module’s ``__init__.py``.
319+
320+
This key should only be used when the cleanup required for this module is either extremely difficult or impossible through the api.
321+
322+
.. _version:
323+
324+
**version**
325+
326+
.. container:: ps-3 pb-3
327+
328+
:badge-primary:`str`
329+
330+
Specifies the `semantic version`_ of the module.
331+
332+
.. _website:
333+
334+
**website**
335+
336+
.. container:: ps-3 pb-3
337+
338+
:badge-primary:`str`
339+
340+
Specifies the website url of the module author.
341+
342+
.. _semantic version: https://semver.org
157343
.. _existing categories: {GITHUB_PATH}/odoo/addons/base/data/ir_module_category_data.xml

Diff for: ‎extensions/badges/__init__.py

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
from docutils import nodes
2+
from sphinx.util.docutils import SphinxRole
3+
4+
COLORS = {
5+
'primary',
6+
'secondary',
7+
'success',
8+
'danger',
9+
'warning',
10+
'info',
11+
'light',
12+
'dark',
13+
}
14+
15+
16+
def setup(app):
17+
for color in COLORS:
18+
app.add_role(f'badge-{color}', Badge(color))
19+
app.add_role(f'badge-rounded-{color}', Badge(color, rounded=True))
20+
21+
return {
22+
'parallel_read_safe': True,
23+
'parallel_write_safe': True,
24+
}
25+
26+
27+
def badge_classes(color, rounded=False):
28+
classes = ['badge', f'bg-{color}']
29+
30+
if color in ('warning', 'info', 'light'):
31+
classes.extend(['text-dark'])
32+
33+
if rounded:
34+
classes.extend(['rounded-pill'])
35+
36+
return classes
37+
38+
39+
class Badge(SphinxRole):
40+
def __init__(self, color, rounded=False):
41+
super().__init__()
42+
self.color = color
43+
self.rounded = rounded
44+
45+
def run(self):
46+
node = nodes.inline(
47+
self.rawtext,
48+
self.text,
49+
classes=badge_classes(self.color, self.rounded)
50+
)
51+
52+
return [node], []

Diff for: ‎static/css/odoo.css

+5
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,8 @@ p.rubric {
2424
.section .section .section .section .section p.rubric {
2525
font-size: 12px;
2626
}
27+
28+
.threecols div.col.container {
29+
width: 33%;
30+
float:left;
31+
}

0 commit comments

Comments
 (0)
Please sign in to comment.