On Saturday, June 10, 2017 at 1:17:32 AM UTC+9, Sergi Almacellas Abellana wrote: > > > > On 9 de juny de 2017 18.07.18 CEST, "Dr. Praveen Bhatia" < > praveen...@sumpurn.com <javascript:>> wrote: > > > > > >On Friday, June 9, 2017 at 11:55:20 PM UTC+9, Sergi Almacellas Abellana > > > >wrote: > >> > >> El 09/06/17 a les 16:50, Dr. Praveen Bhatia ha escrit: > >> > > >> > > >> > ================= > >> > Is there a simpler easier way to set the admin password by code? > >> You can use the TRYTONPASSFILE environment variable in conjunction > >with > >> the trytond-admin --password flag. Running: > >> > >> trytond-admin --help > >> > >> > >I want to do it within the python program and not go to the cmd shell. > >The > >reason is that I am experimenting with the company, and changing the > >program, dropping the database, creating again and restarting. So going > >to > >the command shell every time is irritating. > > > > Then you should call the run [1]method of trytond.admin module. > > Hope it helps! > > [1] http://hg.tryton.org/trytond/file/9810c81cebe7/trytond/admin.py#l19 >
Yes, I am already using it (trytond.admin.run()) in the example code that I wrote above. ie. trytond.admin.run(xx) It prompts me twice to input and confirm the new password, which is also a little bit irritating for programming in each iteration. Is their a better way, when I can just set a fixed password in the program, without having to type a new one twice. Something like: setAdminPassword('mypassword') and I am not prompted for passwords..... > -- > Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi > brevedad. > -- You received this message because you are subscribed to the Google Groups "tryton" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/1fc43dee-c641-43f9-9d2f-154a89d57fe7%40googlegroups.com.