forked from nmbooker/oekit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
odoo.lsmod
executable file
·35 lines (27 loc) · 868 Bytes
/
odoo.lsmod
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#! /usr/bin/env python
"""List the installed modules on an Odoo server.
"""
import sys
import argparse
from oekit.oe_client_env import OEClientEnv
def main(options):
"""Main program."""
peek = OEClientEnv().get_erppeek_client()
ir_module_module = peek.model('ir.module.module')
modules = ir_module_module.browse([('state', '=', 'installed')])
names = (module.name for module in modules)
sys.stdout.writelines(map(termline, names))
return
def termline(astr):
return astr + "\n"
def get_options():
"""Get options for the script."""
parser = argparse.ArgumentParser(
description="List the installed modules on an Odoo server",
)
# parser.add_argument() calls here
options = parser.parse_args()
# extra processing of options here
return options
if __name__ == "__main__":
main(get_options())