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/", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
  File "/opt/openerp/server/openerp/modules/", line 180, in get
    update_module, pooljobs)
  File "/opt/openerp/server/openerp/modules/", line 202, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/opt/openerp/server/openerp/modules/", line 471, in load_modules
    modobj.update_list(cr, 1)
  File "/opt/openerp/server/openerp/addons/base/module/", line 497, in update_list
    self._update_category(cr, uid, mod, terp.get('category', 'Uncategorized'))
  File "/opt/openerp/server/openerp/addons/base/module/", line 551, in _update_category
  File "/opt/openerp/server/openerp/osv/", line 478, in __getattr__
    raise AttributeError(e)
AttributeError: 'Field name not found in browse_record(ir.module.category, 2)'

Question information

English Edit question
OpenUpgrade Server Edit question
No assignee Edit question
Last query:
Last reply:

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: