AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

Asked by Simon Vass on 2012-08-29

When I run the migration script on my 6.0.4 db to update to 6.1 I get.

Traceback (most recent call last):
  File "/opt/openerp/server/openerp-server", line 95, in preload_registry
    db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=config['init'] or config['update'], pooljobs=False)
  File "/opt/openerp/server/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
  File "/opt/openerp/server/openerp/modules/registry.py", line 180, in get
    update_module, pooljobs)
  File "/opt/openerp/server/openerp/modules/registry.py", line 202, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/opt/openerp/server/openerp/modules/loading.py", line 471, in load_modules
    modobj.update_list(cr, 1)
  File "/opt/openerp/server/openerp/addons/base/module/module.py", line 497, in update_list
    self._update_category(cr, uid, mod, terp.get('category', 'Uncategorized'))
  File "/opt/openerp/server/openerp/addons/base/module/module.py", line 551, in _update_category
    current_category_path.insert(0, current_category.name)
  File "/opt/openerp/server/openerp/osv/orm.py", line 478, in __getattr__
    raise AttributeError(e)
AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

Question information

Language:
English Edit question
Status:
Solved
For:
OpenUpgrade Server Edit question
Assignee:
No assignee Edit question
Last query:
2012-08-29
Last reply:
2012-10-06

Made a question out of this bug report as other people may encounter the issue too.

Solved as per last comments

Ah, the issue comments are not transferred to the Answer. See the linked bug report for discussion. The issue was caused by mysteriously missing foreign keys on the ir_module_module table. This comment contains the code to re-add the foreign keys: https://bugs.launchpad.net/openupgrade-server/+bug/1043234/comments/21