Skip to content

Instantly share code, notes, and snippets.

@beledouxdenis
Last active October 16, 2019 09:04
Show Gist options
  • Save beledouxdenis/3c8e99f26380cbf435c66aec7b8d61f5 to your computer and use it in GitHub Desktop.
Save beledouxdenis/3c8e99f26380cbf435c66aec7b8d61f5 to your computer and use it in GitHub Desktop.
Display all modules of Odoo to install, as on runbot.
#!/usr/bin/env python3
import os
import sys
BLACKLIST = ['auth_ldap', 'document_ftp', 'base_gengo',
'website_gengo', 'website_instantclick',
'pad', 'pad_project', 'note_pad',
'pos_cache', 'pos_blackbox_be', 'hw_', 'theme_', 'l10n_']
version = sys.argv[1]
addons_folders = [
os.path.expanduser('~/src/odoo/%s/odoo/addons' % version),
os.path.expanduser('~/src/odoo/%s/openerp/addons' % version),
os.path.expanduser('~/src/odoo/%s/addons' % version),
os.path.expanduser('~/src/enterprise/%s' % version)
]
modules = []
for addons_folder in addons_folders:
if not os.path.exists(addons_folder):
continue
for module in os.listdir(addons_folder):
mod_path = os.path.join(addons_folder, module)
if os.path.isdir(mod_path):
if any(os.path.isfile(os.path.join(mod_path, manifest)) for manifest in ('__manifest__.py', '__openerp__.py')):
if not any(module.startswith(blacklisted) for blacklisted in BLACKLIST):
modules.append(module)
print(','.join(modules))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment