Can not switch from sqlite to postgresql backend

Hmmm…
At the moment I can’t login anymore with the client after I tried to deactivate sale_stock_quantity.

Traceback (most recent call last):
File “/usr/bin/tryton”, line 67, in
client.TrytonClient().run()
File “/usr/lib/python2.7/dist-packages/tryton/client.py”, line 293, in run
main.sig_login()
File “/usr/lib/python2.7/dist-packages/tryton/gui/main.py”, line 876, in sig_login
common.Login(func)
File “/usr/lib/python2.7/dist-packages/tryton/common/common.py”, line 1050, in init
func(parameters)
File “/usr/lib/python2.7/dist-packages/tryton/gui/main.py”, line 873, in
host, port, database, username, parameters, language)
File “/usr/lib/python2.7/dist-packages/tryton/rpc.py”, line 72, in login
result = connection.common.db.login(username, parameters, language)
File “/usr/lib/python2.7/xmlrpclib.py”, line 1243, in call
return self.__send(self.__name, args)
File “/usr/lib/python2.7/dist-packages/tryton/jsonrpc.py”, line 296, in __request
raise Fault(*response[‘error’])
Fault: <Fault u"‘res.user’": u’Traceback (most recent call last):\n File “/trytond/wsgi.py”, line 70, in dispatch_request\n return endpoint(request, **request.view_args)\n File “/trytond/protocols/dispatcher.py”, line 41, in rpc\n request, database_name, *request.rpc_params)\n File “/trytond/protocols/dispatcher.py”, line 54, in login\n database_name, user, parameters, language=language)\n File “/trytond/security.py”, line 24, in login\n User = pool.get(‘res.user’)\n File “/trytond/pool.py”, line 170, in get\n return self._pool[self.database_name][type][name]\nKeyError: ‘res.user’\n’>

I think I will start from scratch with tryton and a postgresql database.

Have you tried trytond-admin -d database --all?

trytond-admin -c /etc/tryton/trytond.conf -d tryton --all
Traceback (most recent call last):
File “/usr/bin/trytond-admin”, line 21, in
admin.run(options)
File “/usr/lib/python3/dist-packages/trytond/admin.py”, line 54, in run
installdeps=options.installdeps)
File “/usr/lib/python3/dist-packages/trytond/pool.py”, line 153, in init
lang=lang, installdeps=installdeps)
File “/usr/lib/python3/dist-packages/trytond/modules/init.py”, line 472, in load_modules
_load_modules(update)
File “/usr/lib/python3/dist-packages/trytond/modules/init.py”, line 436, in _load_modules
graph = create_graph(module_list)[0]
File “/usr/lib/python3/dist-packages/trytond/modules/init.py”, line 191, in create_graph
- set((p[0] for p in packages))))
trytond.exceptions.MissingDependenciesException: [‘sale’]

Trying below:
Pip install trytond-sale

Then update all module again

At the moment I’m struggling with
trytond-admin -c /etc/tryton/trytond.conf -d tryton --all
after changing to postgresql and creating the database tryton with user postgres.

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/trytond/backend/init.py”, line 32, in get
‘trytond.backend’, db_type)
ValueError: not enough values to unpack (expected 1, got 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/bin/trytond-admin”, line 21, in
admin.run(options)
File “/usr/lib/python3/dist-packages/trytond/admin.py”, line 20, in run
Database = backend.get(‘Database’)
File “/usr/lib/python3/dist-packages/trytond/backend/init.py”, line 34, in get
raise exception
File “/usr/lib/python3/dist-packages/trytond/backend/init.py”, line 26, in get
import(modname)
File “/usr/lib/python3/dist-packages/trytond/backend/postgresql/init.py”, line 4, in
from .database import *
File “/usr/lib/python3/dist-packages/trytond/backend/postgresql/database.py”, line 16, in
from psycopg2 import connect, Binary
ModuleNotFoundError: No module named ‘psycopg2’

Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File “”, line 1, in
File “/tmp/pip-build-Pdd7e1/trytond-sale/setup.py”, line 8, in
from configparser import ConfigParser
ImportError: No module named configparser

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-Pdd7e1/trytond-sale/

Looks like you are still using the unsupported Python 2.
Tryton is Python 3 only.

Your environment may default using python2.

Can you try
Pip3 install trytond-sale

pip3 install trytond-sale
Requirement already satisfied: trytond-sale in /usr/lib/python3/dist-packages

It looks like your database was initialized but with partially installed modules.
Once all dependency modules are installed, you must run the update of the database with the option --activate-dependencies to ensure new dependencies are activated.

trytond-admin -c /etc/tryton/trytond.conf -d tryton --activate-dependencies

trytond-admin: error: unrecognized arguments: --activate-dependencies

I think you are using a no more supported version of Tryton. You must use at least the series 5.0.

Yes, v4.6.5, Linuxmint package. I was hoping to be able to upgrade to the latest version but maybe it’s better to start with the latest version from scratch. Sadly there seem to be not packages for Linuxmint.

Is there any reason you stick to 4.6.5?

Although no package, but installing from source of trytond should be easy also.
Just clone the source code and the the root folder “python3 setup.py install” should already install.

Yes, I will go this way. All that stuff is very new to me but tryton seems to be a very interesstingly project. I got the source of tryton-5.4.3.tar.gz trytond-5.4.3.tar.gz and tryton-sao-5.4.2.tgz and will install needed modules gradually.

“python3 setup.py install”
ModuleNotFoundError: No module named ‘setuptools’

I have no clue with python.

apt-get install python3-setuptools did the trick.

I would suggest to use a Python virtual environment. In that way you keep your OS clean and install everything inside that environment. You then can also use pip to install and upgrade the different trytond-* packages and their dependencies.
for psycopg2 I always install the psycopg2-binary with pip (inside the environment) so no need for a compiler to compile the binary.