在openerp中使用openupgrade我发现数据库res.user存在问题,因为它找不到与模型有关的特定问题。
错误抛出三个元素:context_lang context_tz和menu_tips
ERROR astro_migrated openerp.osv.orm: Can't find field 'context_tz' in the following view parts composing the view of object model 'res.users':
* res.users.form
Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data model
其他两个字段也一样。我正在尝试调查迁移的数据库和内容,但我看到它们是相同的。
迁移脚本上的代码是关于res.user数据插入的SQL语句:
for row in cr.fetchall():
cr.execute(
"INSERT INTO res_partner "
"(name, active) "
"VALUES(%s,%s) RETURNING id", row[1:])
partner_id = cr.fetchone()[0]
cr.execute(
"UPDATE res_users "
"SET partner_id = %s, "
"openupgrade_7_created_partner_id = %s "
"WHERE id = %s", (partner_id, partner_id, row[0]))