ajouter un console script to change a password
For the moment the process to change the admin password is to connect with an interpreter
hb-tryton-admin interpreter -c trytond.conf -d dbname
And execute :
User = pool.get('res.user')
users = [User(1)]
User.set_password(users, None, 'mot de passe')
User.save(users)
The change is with root user that be dangerous because the data could be locked by root user
we can change the transaction user with transaction.user = 1
. The admin is the better user to change the password.
The goal of the feature is to add a new console script type change-password
with some args
--user-id : id of the user to change the password --user-login : login of the user to change the password --user-password : give the new password, if not define the password will be asked by input. this options is dangerous. --admin-id : the id of the user used to change the password default 0 ou 1. --admin-login : the login of the user used to change the password.
one of the both (--user-id, --user-login) is required, if both are defined the id will be selected one of the both (--admin-id, --admin-login) is required, if both are defined the id will be selected