Skip to content

Commit 1895744

Browse files
committed
[UPD] module_change_auto_install from upstream (OCA/server-tools)
1 parent 9ad3034 commit 1895744

File tree

8 files changed

+150
-64
lines changed

8 files changed

+150
-64
lines changed

module_change_auto_install/README.rst

+34-9
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
Change auto installable modules
33
===============================
44

5-
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
67
!! This file is generated by oca-gen-addon-readme !!
78
!! changes will be overwritten. !!
89
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:803c0e63b0a4fd39047840304e38f292dc26531ff41d17fc433439c1034f8dd7
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
912
1013
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1114
:target: https://odoo-community.org/page/development-status
@@ -19,11 +22,11 @@ Change auto installable modules
1922
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
2023
:target: https://translation.odoo-community.org/projects/server-tools-16-0/server-tools-16-0-module_change_auto_install
2124
:alt: Translate me on Weblate
22-
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/149/16.0
24-
:alt: Try me on Runbot
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/server-tools&target_branch=16.0
27+
:alt: Try me on Runboat
2528

26-
|badge1| |badge2| |badge3| |badge4| |badge5|
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
2730

2831
In odoo, by default some modules are marked as auto installable
2932
by the ``auto_install`` key present in the manifest.
@@ -52,7 +55,7 @@ Installation
5255
You don't have to install this module. To make the features working :
5356

5457
* make the module ``module_change_auto_install`` available in your addons path
55-
* update your ``odoo.cfg`` following the "Configure" section
58+
* either update your ``odoo.cfg`` or set the environment variables following the "Configure" section
5659

5760
Configuration
5861
=============
@@ -63,15 +66,20 @@ Configuration
6366

6467
* (optional) Add a new entry ``modules_auto_install_disabled`` to mark
6568
a list of modules as NOT auto installable.
69+
The environment variable ``ODOO_MODULES_AUTO_INSTALL_DISABLED`` can also be set.
6670

6771
* (optional) Add a new entry ``modules_auto_install_enabled`` to mark
6872
a list of modules as auto installable. This feature can be usefull for companies
6973
that are hosting a lot of Odoo instances for many customers, and want some modules
7074
to be always installed.
75+
The environment variable ``ODOO_MODULES_AUTO_INSTALL_ENABLED`` can also be set.
76+
77+
The values in the configuration file takes precedence over the environment variable
78+
values.
7179

7280
**Typical Settings**
7381

74-
.. code-block:: shell
82+
.. code-block:: cfg
7583
7684
server_wide_modules = web,module_change_auto_install
7785
@@ -86,6 +94,13 @@ Configuration
8694
disable_odoo_online,
8795
account_usability
8896
97+
When using environment variables, the same configuration is:
98+
99+
.. code-block:: shell
100+
101+
export ODOO_MODULES_AUTO_INSTALL_DISABLED=partner_autocomplete,iap,mail_bot
102+
export ODOO_MODULES_AUTO_INSTALL_ENABLED=web_responsive:web,base_technical_features,disable_odoo_online,account_usability
103+
89104
Run your instance and check logs. Modules that has been altered should be present in your log, at the load of your instance:
90105

91106
.. code-block:: shell
@@ -99,7 +114,7 @@ Run your instance and check logs. Modules that has been altered should be presen
99114

100115
if your ``odoo.cfg`` file contains the following configuration:
101116

102-
.. code-block:: shell
117+
.. code-block:: cfg
103118
104119
modules_auto_install_enabled =
105120
account_usability,
@@ -117,6 +132,13 @@ The behaviour will be the following:
117132

118133
* ``point_of_sale`` module will be installed as soon as ``sale`` and ``purchase`` module are installed.
119134

135+
When using environment variables, the same configuration is:
136+
137+
.. code-block:: shell
138+
139+
export ODOO_MODULES_AUTO_INSTALL_ENABLED=account_usability,web_responsive:web,base_technical_features:,point_of_sale:sale/purchase
140+
141+
120142
Development
121143
===========
122144

@@ -130,7 +152,7 @@ Bug Tracker
130152

131153
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-tools/issues>`_.
132154
In case of trouble, please check there if your issue has already been reported.
133-
If you spotted it first, help us smashing it by providing a detailed and welcomed
155+
If you spotted it first, help us to smash it by providing a detailed and welcomed
134156
`feedback <https://github.com/OCA/server-tools/issues/new?body=module:%20module_change_auto_install%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
135157

136158
Do not contact contributors directly about support or help with technical issues.
@@ -147,6 +169,9 @@ Contributors
147169
~~~~~~~~~~~~
148170

149171
* Sylvain LE GAL <https://twitter.com/legalsylvain>
172+
* XCG Consulting, part of `Orbeet <https://orbeet.io/>`__:
173+
174+
* Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
150175

151176
Maintainers
152177
~~~~~~~~~~~

module_change_auto_install/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"name": "Change auto installable modules",
77
"summary": "Customize auto installables modules by configuration",
8-
"version": "16.0.1.0.0",
8+
"version": "16.0.1.0.2",
99
"category": "Tools",
1010
"maintainers": ["legalsylvain"],
1111
"author": "GRAP, Odoo Community Association (OCA)",

module_change_auto_install/i18n/it.po

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
#
4+
msgid ""
5+
msgstr ""
6+
"Project-Id-Version: Odoo Server 16.0\n"
7+
"Report-Msgid-Bugs-To: \n"
8+
"Last-Translator: Automatically generated\n"
9+
"Language-Team: none\n"
10+
"Language: it\n"
11+
"MIME-Version: 1.0\n"
12+
"Content-Type: text/plain; charset=UTF-8\n"
13+
"Content-Transfer-Encoding: \n"
14+
"Plural-Forms: nplurals=2; plural=n != 1;\n"

module_change_auto_install/patch.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
44

55
import logging
6+
import os
67

78
from odoo import modules
89
from odoo.tools import config
@@ -51,10 +52,16 @@ def _overload_load_manifest(module, mod_path=None):
5152
auto_install = res.get("auto_install", False)
5253

5354
modules_auto_install_enabled_dict = _get_modules_dict_auto_install_config(
54-
config.get("modules_auto_install_enabled")
55+
config.get(
56+
"modules_auto_install_enabled",
57+
os.environ.get("ODOO_MODULES_AUTO_INSTALL_ENABLED"),
58+
)
5559
)
5660
modules_auto_install_disabled_dict = _get_modules_dict_auto_install_config(
57-
config.get("modules_auto_install_disabled")
61+
config.get(
62+
"modules_auto_install_disabled",
63+
os.environ.get("ODOO_MODULES_AUTO_INSTALL_DISABLED"),
64+
)
5865
)
5966

6067
if auto_install and module in modules_auto_install_disabled_dict.keys():
@@ -85,6 +92,6 @@ def _overload_load_manifest(module, mod_path=None):
8592

8693

8794
def post_load():
88-
_logger.info("Aplying patch module_change_auto_intall ...")
95+
_logger.info("Applying patch module_change_auto_intall ...")
8996
modules.module.load_manifest = _overload_load_manifest
9097
modules.load_manifest = _overload_load_manifest

module_change_auto_install/readme/CONFIGURE.rst

+21-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@
44

55
* (optional) Add a new entry ``modules_auto_install_disabled`` to mark
66
a list of modules as NOT auto installable.
7+
The environment variable ``ODOO_MODULES_AUTO_INSTALL_DISABLED`` can also be set.
78

89
* (optional) Add a new entry ``modules_auto_install_enabled`` to mark
910
a list of modules as auto installable. This feature can be usefull for companies
1011
that are hosting a lot of Odoo instances for many customers, and want some modules
1112
to be always installed.
13+
The environment variable ``ODOO_MODULES_AUTO_INSTALL_ENABLED`` can also be set.
14+
15+
The values in the configuration file takes precedence over the environment variable
16+
values.
1217

1318
**Typical Settings**
1419

15-
.. code-block:: shell
20+
.. code-block:: cfg
1621
1722
server_wide_modules = web,module_change_auto_install
1823
@@ -27,6 +32,13 @@
2732
disable_odoo_online,
2833
account_usability
2934
35+
When using environment variables, the same configuration is:
36+
37+
.. code-block:: shell
38+
39+
export ODOO_MODULES_AUTO_INSTALL_DISABLED=partner_autocomplete,iap,mail_bot
40+
export ODOO_MODULES_AUTO_INSTALL_ENABLED=web_responsive:web,base_technical_features,disable_odoo_online,account_usability
41+
3042
Run your instance and check logs. Modules that has been altered should be present in your log, at the load of your instance:
3143

3244
.. code-block:: shell
@@ -40,7 +52,7 @@ Run your instance and check logs. Modules that has been altered should be presen
4052

4153
if your ``odoo.cfg`` file contains the following configuration:
4254

43-
.. code-block:: shell
55+
.. code-block:: cfg
4456
4557
modules_auto_install_enabled =
4658
account_usability,
@@ -57,3 +69,10 @@ The behaviour will be the following:
5769
* ``base_technical_features`` will be ALWAYS installed
5870

5971
* ``point_of_sale`` module will be installed as soon as ``sale`` and ``purchase`` module are installed.
72+
73+
When using environment variables, the same configuration is:
74+
75+
.. code-block:: shell
76+
77+
export ODOO_MODULES_AUTO_INSTALL_ENABLED=account_usability,web_responsive:web,base_technical_features:,point_of_sale:sale/purchase
78+
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
* Sylvain LE GAL <https://twitter.com/legalsylvain>
2+
* XCG Consulting, part of `Orbeet <https://orbeet.io/>`__:
3+
4+
* Vincent Hatakeyama <vincent.hatakeyama@xcg-consulting.fr>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
You don't have to install this module. To make the features working :
22

33
* make the module ``module_change_auto_install`` available in your addons path
4-
* update your ``odoo.cfg`` following the "Configure" section
4+
* either update your ``odoo.cfg`` or set the environment variables following the "Configure" section

0 commit comments

Comments
 (0)