diff --git a/CHANGELOG b/CHANGELOG index 3d099fdecd..37f39de616 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,7 @@ * Remove string attribute from views * Don't check write access on model for button with groups * Limit readonly state for xxx2Many +* Add option to update modules list with trytond-admin * Use home directory as default path for database and web root. * Add count option on Action Window Domains * Remove window_name on Action Window diff --git a/trytond/admin.py b/trytond/admin.py index aa5374f1b4..3d9c38dacc 100644 --- a/trytond/admin.py +++ b/trytond/admin.py @@ -45,7 +45,13 @@ def run(options): lang = [x[0] for x in cursor.fetchall()] else: lang = None - Pool(db_name).init(update=options.update, lang=lang) + pool = Pool(db_name) + pool.init(update=options.update, lang=lang) + + if options.update_modules_list: + with Transaction().start(db_name, 0) as transaction: + Module = pool.get('ir.module') + Module.update_list() for db_name in options.database_names: if init[db_name]: diff --git a/trytond/commandline.py b/trytond/commandline.py index 45bb900710..d4788f6a4e 100644 --- a/trytond/commandline.py +++ b/trytond/commandline.py @@ -46,6 +46,8 @@ def get_parser_admin(): metavar='MODULE', help="update a module") parser.add_argument("--all", dest="update", action="append_const", const="ir", help="update all installed modules") + parser.add_argument("-m", "--update-modules-list", action="store_true", + dest="update_modules_list", help="Update list of tryton modules") parser.epilog = ('The first time a database is initialized admin ' 'password is read from file defined by TRYTONPASSFILE '