Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/doblib/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "0.19.4"
VERSION = "0.19.5"
9 changes: 9 additions & 0 deletions src/doblib/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ def check_auto_install(self, db_name):
states = frozenset(("installed", "to install", "to upgrade"))

with self.env(db_name, False) as env:
countries = env["res.company"].search([]).mapped("country_id")

domain = [("state", "=", "uninstalled"), ("auto_install", "=", True)]
modules = env["ir.module.module"].search(domain)
auto_install = {module: module.dependencies_id for module in modules}
Expand All @@ -124,6 +126,13 @@ def check_auto_install(self, db_name):
while new_module:
new_module = False
for module, dependencies in auto_install.items():
if (
"country_ids" in module._fields
and module.country_ids
and not (module.country_ids & countries)
):
continue

if all(
dep.state in states or dep.depend_id in to_install
for dep in dependencies
Expand Down