OpenERP 7升级后“ERROR:relation”ir_model_constraint“不存在”

时间:2012-12-07 13:49:05

标签: openerp

我一直在使用OpenERP 6 OK并决定升级到第7版。

我从http://nightly.openerp.com/trunk/nightly/deb/下载了openerp_7.0alpha-20121206-000102-1_all.deb并安装了它。现在,当我浏览http://localhost:8069时,我无法再选择数据库(因为当有一个数据库时没有理由显示选择器时),登录后我得到:

OpenERP Server Error
Client Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/http.py", line 195, in dispatch
    response["result"] = method(self, **self.params)
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/controllers/main.py", line 833, in authenticate
    req.session.authenticate(db, login, password, env)
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 113, in authenticate
    uid = self.proxy('common').authenticate(db, login, password, env)
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 28, in proxy_method
    result = self.session.send(self.service_name, method, *args)
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 101, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)


Server Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/addons/web/session.py", line 87, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 361, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 413, in dispatch
    return fn(*params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 424, in exp_authenticate
    res_users = pooler.get_pool(db).get('res.users')
  File "/usr/lib/pymodules/python2.7/openerp/pooler.py", line 50, in get_pool
    return get_db_and_pool(db_name, force_demo, status, update_module)[1]
  File "/usr/lib/pymodules/python2.7/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
  File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 156, in get
    update_module, pooljobs)
  File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 178, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 296, in load_modules
    loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report)
  File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 164, in load_module_graph
    init_module_models(cr, package.name, models)
  File "/usr/lib/pymodules/python2.7/openerp/modules/module.py", line 373, in init_module_models
    result = obj._auto_init(cr, {'module': module_name})
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3211, in _auto_init
    self._add_sql_constraints(cr)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3350, in _add_sql_constraints
    self._save_constraint(cr, conname, 'u')
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2859, in _save_constraint
    """, (constraint_name, self._module))
  File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 162, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 227, in execute
    res = self._obj.execute(query, params)
ProgrammingError: relation "ir_model_constraint" does not exist
LINE 2:             SELECT 1 FROM ir_model_constraint, ir_module_mod...
                                  ^

所以我尝试手动运行它:

sudo openerp-server stop
su - openerp
openerp-server -d openerp1 -u all

我得到了

2012-12-07 07:00:43,417 7584 ERROR openerp1 openerp: Failed to initialize database `openerp1`.
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/cli/server.py", line 97, in preload_registry
    db, registry = openerp.pooler.get_db_and_pool(dbname, update_module=openerp.tools.config['init'] or openerp.tools.config['update'], pooljobs=False)
  File "/usr/lib/pymodules/python2.7/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module, pooljobs)
  File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 156, in get
    update_module, pooljobs)
  File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 178, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 296, in load_modules
    loaded_modules, processed_modules = load_module_graph(cr, graph, status, perform_checks=(not update_module), report=report)
  File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 164, in load_module_graph
    init_module_models(cr, package.name, models)
  File "/usr/lib/pymodules/python2.7/openerp/modules/module.py", line 373, in init_module_models
    result = obj._auto_init(cr, {'module': module_name})
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3211, in _auto_init
    self._add_sql_constraints(cr)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 3350, in _add_sql_constraints
    self._save_constraint(cr, conname, 'u')
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2859, in _save_constraint
    """, (constraint_name, self._module))
  File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 162, in wrapper
    return f(self, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/openerp/sql_db.py", line 227, in execute
    res = self._obj.execute(query, params)
ProgrammingError: relation "ir_model_constraint" does not exist
LINE 2:             SELECT 1 FROM ir_model_constraint, ir_module_mod...

我可以做什么,或者我应该做什么升级?

2 个答案:

答案 0 :(得分:3)

目前没有从OpenERP 6.0到7.0的免费升级机制。 OpenERP SA通过销售商业升级解决方案谋生,如果您与他们签订年度支持合同,您将获得相当大的折扣。

使用-u all可能会尝试升级您的数据库架构,但是il不会迁移您的数据(即,如果重命名了一列,您将无法将数据从旧列移动到新列),并且也不会迁移视图:具有相同XML ID的新视图将替换旧视图,创建新视图,旧视图仍然存在,可能引用不再存在的字段。基本上你的数据库现在一团糟,希望你有一个备份,你可以用它来继续运行v 6.0。

答案 1 :(得分:2)

您是否在同一台机器上安装了V6.1?

当您使用旧版本模块和新版本模块时会发生此错误。

我建议安装虚拟机并再试一次,如果我正确的话,你可以取消包,删除与包相关的所有文件(模块)并重新安装。

如果您需要将数据库修复为旧版本,请重新安装6.1或6.0并使用参数-u all -d nameofdb启动服务器。

问候。