How to install and activate module?

How do you install a module? Ive already ran pip install trytond_sales and it installed correctly but im lost on what to do next? The client also doesnt list the sales module when i checked the module section.

Im running trytond 5.6

Maybe you can check you installed in correct env ? I mean, pip3 install trytond_sales?. Latest release of tryton use python 3

If you install a new module while using an existing database, you must run the trytond-admin --update-modules-list on the database. Then you will be able to activate it.

I did that (as root) and the newly installed modules still did not show up for activation. Please help clarify if the command has to be run as user “tryton”
ps: my apologies for jumping in here Tryhard.

Thanks

It must be run using the same user as the trytond service is running and with the same configuration file.
And it must be run once for each database -d <database name>.

My trytond service user is tryton, would the command look something like:
trytond-admin --update-modules-list --user tryton --config /etc/tryton/trytond.conf
-d mydatabase
Thanks

@ced

Its a clean install.
Heres what i did prior to typing your suggestion

  1. Create the database in postgresql
  2. Used the command trytond-admin -c trytond.conf -d trytontest2 --all. I think this is to prime the db
  3. Then i pip install my first module which is stock which succeeded

After all of those steps i used your suggestion but nothing happened. May i ask exactly what does your command do?

From my understanding (of course Ced will correct if I’m wrong) the command is supposed to update the database with the module you’ve just installed so that it becomes available for activation on the frontend/client. This db_setup might help you.

I have the same issue as you (trying to get my newly installed modules to show up for activation) so, I thought there’s no need to start another topic.

I used this command on opensuse 15.1 Leap: (not sure if it’s correct. Could someone please help clarify).
trytond-admin -u tryton -c /etc/tryton/trytond.conf -d mydb --update-moddules-list

But python threw this error:
File “/usr/lib/python3.6/site-packages/trytond/backend/postgresql/database.py”, line 66, in execute cursor.execute(self, slq, args)
psycopg2.ProgrammingError: relation “ir_configuration_id_seq” already exists

How do I deal with this error?

I think you did not run the correct command. Please give the exact command and the output of it.

Without the full traceback it is impossible to help.

command: trytond-admin -u tryton -c /etc/tryton/trytond.conf -d trytondb --update-moddules-list
Traceback (most recent call last):
File "usr/bin/trytond-admin", line 21, in <module> admin.run(options) 
File "/usr/lib/python3.6/site-packages/trytond/admin.py", in line 31, in run database.init() 
File "/usr/lib/python3.6/site-packages/trytond/backend/postgresql/database.py", line 239, in init cursor.execute(line)
File "/usr/lib/python3.6/site-packages/trytond/backend/postgresql/database.py", line 66, in execute cursor.execute(self, slq, args)
psycopg2.ProgrammingError: relation "ir_configuration_id_seq" already exists

Thanks

What is this module you try to update?

I suspect you are not running the command with the same database user that initialize it.

@ced
python trytond-admin --update-modules-list

You must specify the configuration and the database.

They are: company_work_time, timesheet and project

Pretty sure I’m using the same database name, double checked in postresql as well.

Then why are you trying to update the module names tryton?
-u option is for update a module, check the --help.

I said database user name?

Database username is always tryton.
I thought the -u option is username. My bad.
So given that you understand what I’m trying to do now, would the command look something like:
tryton trytond-admin -u company_work_time -c /etc/tryton/trytond.conf
-d mydatabase --update-modules-list ? omit the -u option altogether or how?

Update:

I have been able to update tryton with new modules. The modules can then be activated in the client/website. This is on opensuse 15.1Leap/tryton5.02/gnuhealth3.6. I used this command after modules installation:

su tryton -s /bin/bash
trytond-admin -c /etc/tryton/trytond.conf -d mydatabase --update-modules-list