summaryrefslogtreecommitdiff
path: root/openerpcommand/update.py
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2013-01-11 14:46:57 +0100
committerVo Minh Thu <vmt@openerp.com>2013-01-11 14:46:57 +0100
commit3da57500c279cd19fa6d561eef149d708383138d (patch)
treee6ea46397217349ff0381b91346a1ba02394e14b /openerpcommand/update.py
parent3478333bca1a28483c1c7eb90431cb1e979c74ba (diff)
[ADD] oe: provides sane (unfucked) command-line interface.
The implementation is far from perfect. Some improvements are waiting in its previous location: lp:~openerp/openerp-command. Some docs are provided, see doc/openerp-command.rst and doc/adding-command.rst. bzr revid: vmt@openerp.com-20130111134657-im2f3uqjluyo4pm6
Diffstat (limited to 'openerpcommand/update.py')
-rw-r--r--openerpcommand/update.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/openerpcommand/update.py b/openerpcommand/update.py
new file mode 100644
index 00000000000..66a47dc5692
--- /dev/null
+++ b/openerpcommand/update.py
@@ -0,0 +1,19 @@
+"""
+Update an existing OpenERP database.
+"""
+
+def run(args):
+ assert args.database
+ import openerp
+ config = openerp.tools.config
+ config['update']['all'] = 1
+ openerp.modules.registry.RegistryManager.get(
+ args.database, update_module=True)
+
+def add_parser(subparsers):
+ parser = subparsers.add_parser('update',
+ description='Update an existing OpenERP database.')
+ parser.add_argument('-d', '--database', metavar='DATABASE', required=True,
+ help='the database to update')
+
+ parser.set_defaults(run=run)