Can not update module lists

Hi,
when i run the command:
sudo trytond-admin -c /etc/tryton/trytond.conf -d tryton --update-modules-list

i receive errors:

Traceback (most recent call last):
  File "/usr/local/bin/trytond-admin", line 23, in <module>
    admin.run(options)
  File "/usr/local/lib/python3.8/dist-packages/trytond/admin.py", line 63, in run
    Module.update_list()
  File "/usr/local/lib/python3.8/dist-packages/trytond/ir/module.py", line 300, in update_list
    module, = cls.create([{
  File "/usr/local/lib/python3.8/dist-packages/trytond/model/modelsql.py", line 161, in wrapper
    return func(cls, *args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/trytond/model/modelsql.py", line 728, in create
    cls.trigger_create(records)
  File "/usr/local/lib/python3.8/dist-packages/trytond/model/modelstorage.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/trytond/model/modelstorage.py", line 201, in trigger_create
    triggers = Trigger.get_triggers(cls.__name__, 'create')
  File "/usr/local/lib/python3.8/dist-packages/trytond/ir/trigger.py", line 174, in get_triggers
    triggers = cls.search([
  File "/usr/local/lib/python3.8/dist-packages/trytond/model/modelsql.py", line 1515, in search
    cursor.execute(*select)
  File "/usr/local/lib/python3.8/dist-packages/trytond/backend/postgresql/database.py", line 68, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.UndefinedColumn: column a.action does not exist
LINE 1: SELECT "a"."id" AS "id", "a"."action" AS "action", "a"."acti...
                                 ^
HINT:  Perhaps you meant to reference the column "a.active".

i installed modules by the script i created: Need help for Installing all modules with shell script

and installed tryton on ubuntu by apt install tryton-server as suggested.

It seems your database is not updated with your server version.
You should update the database using the following comand:

trytond-admin -c /etc/tryton/trytond.conf -d tryton --all

Once the update process is finished you should be able to update the module list without problems.

Traceback (most recent call last):
  File "/usr/local/bin/trytond-admin", line 23, in <module>
    admin.run(options)
  File "/usr/local/lib/python3.8/dist-packages/trytond/admin.py", line 57, in run
    pool.init(update=options.update, lang=list(lang),
  File "/usr/local/lib/python3.8/dist-packages/trytond/pool.py", line 165, in init
    restart = not load_modules(
  File "/usr/local/lib/python3.8/dist-packages/trytond/modules/__init__.py", line 438, in load_modules
    _load_modules(update)
  File "/usr/local/lib/python3.8/dist-packages/trytond/modules/__init__.py", line 406, in _load_modules
    load_module_graph(graph, pool, update, lang)
  File "/usr/local/lib/python3.8/dist-packages/trytond/modules/__init__.py", line 238, in load_module_graph
    cls.__register__(module)
  File "/usr/local/lib/python3.8/dist-packages/trytond/model/modelsql.py", line 219, in __register__
    super(ModelSQL, cls).__register__(module_name)
  File "/usr/local/lib/python3.8/dist-packages/trytond/model/model.py", line 126, in __register__
    ModelField.register(cls, module_name, model_id)
  File "/usr/local/lib/python3.8/dist-packages/trytond/ir/model.py", line 287, in register
    cursor.execute(*ir_model_field.join(ir_model,
  File "/usr/local/lib/python3.8/dist-packages/trytond/backend/postgresql/database.py", line 68, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.UndefinedColumn: column a.access does not exist
LINE 1: ..., "a"."module" AS "module", "a"."help" AS "help", "a"."acces...
                                                             ^

now i got this.

It seems you are missing some queries from the 5.8 to 6.0 migration

i tried section [SQL] fix currency, invoice_type and party on invoice line
but i got;

ERROR: relation “account_invoice_line” does not exist
LINE 1: UPDATE account_invoice_line SET currency = (SELECT currency …
^
SQL state: 42P01
Character: 8

but i applied [SQL] before update, add access on field and i got another error;

24442 139667543680832 [2022-05-13 19:42:55,162] ERROR trytond.convert Could not delete id 2 from model res.user.
There may be a relation that points to this resource that must be manually fixed before restarting the update.
Traceback (most recent call last):
File “/usr/local/lib/python3.8/dist-packages/trytond/convert.py”, line 811, in post_import
Model.delete([Model(db_id)])
File “/usr/local/lib/python3.8/dist-packages/trytond/res/user.py”, line 420, in delete
raise DeleteError(gettext(‘res.msg_user_delete_forbidden’))
trytond.res.user.DeleteError: For logging purposes users cannot be deleted, instead they should be deactivated. -

id 2 is “user_cron_trigger” should i delete it ? i dont think so!

but this sudo trytond-admin -c /etc/tryton/trytond.conf -d tryton --update-modules-list worked without error after applying [SQL] before update, add access on field but later tryton client gives error;

Traceback (most recent call last):
File “/Users/ced/tryton-5.0/tryton/gui/main.py”, line 275, in do_activate
File “/Users/ced/tryton-5.0/tryton/common/common.py”, line 998, in init
File “/Users/ced/tryton-5.0/tryton/rpc.py”, line 88, in login
File “/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/xmlrpc/client.py”, line 1112, in call
File “/Users/ced/tryton-5.0/tryton/jsonrpc.py”, line 286, in __request
tryton.jsonrpc.Fault: <Fault ‘column a.action_function does not exist\nLINE 1: SELECT “a”.“id” AS “id”, “a”.“action_function” AS "action_fu…\n ^\n’: ‘Traceback (most recent call last):\n File “/trytond/wsgi.py”, line 73, in dispatch_request\n return endpoint(request, **request.view_args)\n File “/trytond/protocols/dispatcher.py”, line 45, in rpc\n return methods.get(request.rpc_method, _dispatch)(\n File “/trytond/protocols/dispatcher.py”, line 62, in login\n session = security.login(\n File “/trytond/security.py”, line 51, in login\n session = user_id, Session.new()\n File “/trytond/ir/session.py”, line 51, in new\n session, = cls.create([values])\n File “/trytond/ir/session.py”, line 149, in create\n return super(Session, cls).create(vlist)\n File “/trytond/model/modelsql.py”, line 147, in wrapper\n return func(cls, *args, **kwargs)\n File “/trytond/model/modelsql.py”, line 659, in create\n cls.trigger_create(records)\n File “/trytond/model/modelstorage.py”, line 36, in wrapper\n return func(*args, **kwargs)\n File “/trytond/model/modelstorage.py”, line 119, in trigger_create\n triggers = Trigger.get_triggers(cls.name, ‘create’)\n File “/trytond/ir/trigger.py”, line 156, in get_triggers\n triggers = cls.search([\n File “/trytond/model/modelsql.py”, line 1242, in search\n cursor.execute(*select)\n File “/trytond/backend/postgresql/database.py”, line 66, in execute\n cursor.execute(self, sql, args)\npsycopg2.errors.UndefinedColumn: column a.action_function does not exist\nLINE 1: SELECT “a”.“id” AS “id”, “a”.“action_function” AS "action_fu…\n ^\n\n’>

i solved the problems by reinstalling from the beginning.