Does not update from 7.0 to 7.2

When trying to update tryton from 7.0 to 7.2 it throws this error:

trytond-admin -c /etc/tryton/trytond.conf -d trytondb --all
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.11/trytond-admin", line 33, in <module>
    admin.run(options)
  File "/usr/lib/python3.11/site-packages/trytond/admin.py", line 57, in run
    pool.init(update=options.update, lang=list(lang),
  File "/usr/lib/python3.11/site-packages/trytond/pool.py", line 144, in init
    restart = not load_modules(
                  ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/trytond/modules/__init__.py", line 382, in load_modules
    _load_modules(update)
  File "/usr/lib/python3.11/site-packages/trytond/modules/__init__.py", line 352, in _load_modules
    load_module_graph(graph, pool, update, lang, indexes)
  File "/usr/lib/python3.11/site-packages/trytond/modules/__init__.py", line 190, in load_module_graph
    cls.__register__(module)
  File "/usr/lib/python3.11/site-packages/trytond/model/fields/fmany2one.py", line 29, in __register__
    table_h.add_fk(
  File "/usr/lib/python3.11/site-packages/trytond/backend/postgresql/table.py", line 430, in add_fk
    cursor.execute(
  File "/usr/lib/python3.11/site-packages/trytond/backend/postgresql/database.py", line 71, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.ForeignKeyViolation: inserción o actualización en la tabla «ir_ui_view» viola la llave foránea «ir_ui_view_model_model_fkey»
DETAIL:  La llave (model)=(account.fr.fec.start) no está presente en la tabla «ir_model».

applying the -vv option shows the error in this fragment

1912 140231151462208 [2024-05-14 01:20:02,786] INFO trytond.modules ir:register ir.ui.view
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.11/trytond-admin", line 33, in <module>
    admin.run(options)
  File "/usr/lib/python3.11/site-packages/trytond/admin.py", line 57, in run
    pool.init(update=options.update, lang=list(lang),
  File "/usr/lib/python3.11/site-packages/trytond/pool.py", line 144, in init
    restart = not load_modules(
                  ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/trytond/modules/__init__.py", line 382, in load_modules
    _load_modules(update)
  File "/usr/lib/python3.11/site-packages/trytond/modules/__init__.py", line 352, in _load_modules
    load_module_graph(graph, pool, update, lang, indexes)
  File "/usr/lib/python3.11/site-packages/trytond/modules/__init__.py", line 190, in load_module_graph
    cls.__register__(module)
  File "/usr/lib/python3.11/site-packages/trytond/model/fields/fmany2one.py", line 29, in __register__
    table_h.add_fk(
  File "/usr/lib/python3.11/site-packages/trytond/backend/postgresql/table.py", line 430, in add_fk
    cursor.execute(
  File "/usr/lib/python3.11/site-packages/trytond/backend/postgresql/database.py", line 71, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.ForeignKeyViolation: inserción o actualización en la tabla «ir_ui_view» viola la llave foránea «ir_ui_view_model_model_fkey»
DETAIL:  La llave (model)=(account.fr.fec.start) no está presente en la tabla «ir_model».

It looks like you have some remaining of an activation of the module account_fr. You need to clean up manually the ir_ui_view from view of model that does not exist anymore in your setup.

Excuse my ignorance on the subject.
I have never done anything similar.
Can you please tell me how to do it?

If you do not have the account_fr activated, you can run:

DELETE FROM ir_ui_view WHERE model = 'account.fr.fec.start'

I still needed to clean this one:
ir_ui_view_tree_width (move_description, account.general_ledger.line, name, account.general_ledger.account)

grateful for the help provided

note: at the end of the line you need “;”
DELETE FROM ir_ui_view WHERE model = 'account.fr.fec.start';

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.