Allow to specify translatable languages in trytond-admin
issue5961 review27711002
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Allow to specify translatable languages in trytond-admin
|
||||
* Add datetime_field on Reference
|
||||
* Merge Spanish's into Spanish (Latin American)
|
||||
* Do not check write access on model for wizard with groups
|
||||
|
||||
+5
-5
@@ -43,14 +43,14 @@ def run(options):
|
||||
lang = Table('ir_lang')
|
||||
cursor.execute(*lang.select(lang.code,
|
||||
where=lang.translatable == True))
|
||||
lang = [x[0] for x in cursor.fetchall()]
|
||||
lang = set([x[0] for x in cursor.fetchall()])
|
||||
main_lang = config.get('database', 'language')
|
||||
if main_lang not in lang:
|
||||
lang.append(main_lang)
|
||||
lang.add(main_lang)
|
||||
else:
|
||||
lang = None
|
||||
lang = set()
|
||||
lang |= set(options.languages)
|
||||
pool = Pool(db_name)
|
||||
pool.init(update=options.update, lang=lang)
|
||||
pool.init(update=options.update, lang=list(lang))
|
||||
|
||||
if options.update_modules_list:
|
||||
with Transaction().start(db_name, 0) as transaction:
|
||||
|
||||
@@ -51,6 +51,8 @@ def get_parser_admin():
|
||||
action='store_true', help="set the admin password")
|
||||
parser.add_argument("-m", "--update-modules-list", action="store_true",
|
||||
dest="update_modules_list", help="Update list of tryton modules")
|
||||
parser.add_argument("-l", "--language", dest="languages", nargs='+',
|
||||
default=[], metavar='CODE', help="Load language translations")
|
||||
|
||||
parser.epilog = ('The first time a database is initialized '
|
||||
'or when the password is set, the admin password is read '
|
||||
|
||||
Reference in New Issue
Block a user