Skip to content

Commit a88eff2

Browse files
author
cicd
committed
skip functions
1 parent 6c69d18 commit a88eff2

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

wodoo/lib_module.py

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,12 +1678,42 @@ def migrate():
16781678

16791679

16801680
@odoo_module.command()
1681+
@click.option(
1682+
"--skip-odoo",
1683+
is_flag=True,
1684+
help="Skip odoo modules (default: False)",
1685+
)
1686+
@click.option(
1687+
"--skip-enterprise",
1688+
is_flag=True,
1689+
help="Skip enterprise modules (default: False)",
1690+
)
1691+
@click.option(
1692+
"--skip-oca",
1693+
is_flag=True,
1694+
help="Skip OCA modules (default: False)",
1695+
)
16811696
@pass_config
16821697
@click.pass_context
1683-
def list_modules(ctx, config):
1698+
def list_modules(ctx, config, skip_odoo, skip_enterprise, skip_oca):
16841699
modules = list(sorted(get_all_modules_installed_by_manifest(config)))
1700+
from .module_tools import Modules, Module
1701+
from .odoo_config import MANIFEST
1702+
m = MANIFEST()
1703+
odoo_dir = m.get("odoo_dir", "odoo")
1704+
1705+
def _filter(module):
1706+
m = Module.get_by_name(module)
1707+
if skip_odoo and str(m.path).startswith(odoo_dir + "/"):
1708+
return False
1709+
if skip_enterprise and str(m.path).startswith("enterprise/"):
1710+
return False
1711+
if skip_oca and 'oca' in str(m.path).split("/")[0].lower():
1712+
return False
1713+
return True
1714+
16851715
print("---")
1686-
for m in modules:
1716+
for m in [x for x in modules if _filter(x)]:
16871717
print(m)
16881718

16891719

0 commit comments

Comments
 (0)