Openerp 在odoo中,高级视图编辑器用于保存文件

Openerp 在odoo中,高级视图编辑器用于保存文件,openerp,odoo-8,Openerp,Odoo 8,在odoo中自定义默认模板时出错。 错误位于电子商务模块的类别列表中。 保存我的更改后,Odoo在UI上报告了一个错误,并建议回滚。从那时起,奥多的网站就根本不起作用了 我在哪里可以找到服务器上要更改的已修改文件?放弃我的更改? 这是我的日志跟踪。。。这帮不了什么忙 2016-04-25 19:41:13,773 1505 ERROR fa_prod werkzeug: Error on request: Traceback (most recent call last): File "/u

在odoo中自定义默认模板时出错。 错误位于电子商务模块的类别列表中。 保存我的更改后,Odoo在UI上报告了一个错误,并建议回滚。从那时起,奥多的网站就根本不起作用了

我在哪里可以找到服务器上要更改的已修改文件?放弃我的更改? 这是我的日志跟踪。。。这帮不了什么忙

2016-04-25 19:41:13,773 1505 ERROR fa_prod werkzeug: Error on request:
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 177, in run_wsgi
    execute(self.server.app)
  File "/usr/lib/python2.7/dist-packages/werkzeug/serving.py", line 165, in execute
    application_iter = app(environ, start_response)
  File "/opt/openerp/odoo/openerp/service/server.py", line 290, in app
    return self.app(e, s)
  File "/opt/openerp/odoo/openerp/service/wsgi_server.py", line 214, in application
    return werkzeug.contrib.fixers.ProxyFix(application_unproxied)(environ, start_response)
  File "/usr/lib/python2.7/dist-packages/werkzeug/contrib/fixers.py", line 144, in __call__
    return self.app(environ, start_response)
  File "/opt/openerp/odoo/openerp/service/wsgi_server.py", line 202, in application_unproxied
    result = handler(environ, start_response)
  File "/opt/openerp/odoo/openerp/http.py", line 1290, in __call__
    return self.dispatch(environ, start_response)
  File "/opt/openerp/odoo/openerp/http.py", line 1264, in __call__
    return self.app(environ, start_wrapped)
  File "/usr/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 588, in __call__
    return self.app(environ, start_response)
  File "/opt/openerp/odoo/openerp/http.py", line 1428, in dispatch
    ir_http = request.registry['ir.http']
  File "/opt/openerp/odoo/openerp/http.py", line 346, in registry
    return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None
  File "/opt/openerp/odoo/openerp/modules/registry.py", line 339, in get
    update_module)
  File "/opt/openerp/odoo/openerp/modules/registry.py", line 370, in new
    openerp.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/opt/openerp/odoo/openerp/modules/loading.py", line 351, in load_modules
    force, status, report, loaded_modules, update_module)
  File "/opt/openerp/odoo/openerp/modules/loading.py", line 255, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/opt/openerp/odoo/openerp/modules/loading.py", line 157, in load_module_graph
    init_module_models(cr, package.name, models)
  File "/opt/openerp/odoo/openerp/modules/module.py", line 293, in init_module_models
    obj._auto_end(cr, {'module': module_name})
  File "/opt/openerp/odoo/openerp/api.py", line 250, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/openerp/odoo/openerp/models.py", line 2710, in _auto_end
    cr.execute('ALTER TABLE "%s" ADD FOREIGN KEY ("%s") REFERENCES "%s" ON DELETE %s' % (t, k, r, d))
  File "/opt/openerp/odoo/openerp/sql_db.py", line 158, in wrapper
    return f(self, *args, **kwargs)
  File "/opt/openerp/odoo/openerp/sql_db.py", line 234, in execute
    res = self._obj.execute(query, params)
ProgrammingError: there is no primary key for referenced table "res_users"

在我看来,您确实在res_users表中犯了一个错误。 如果您有备份:localhost:8069/web/database/manager,也许您可以在这个链接上重新获取它
另一种方式是,您可以使用本地主机5432上的postgresql管理器访问数据库。

程序源代码位于插件/模块名称字典中。


我希望这对您有用。

在我看来,您确实在res_users表中犯了一个错误。 如果您有备份:localhost:8069/web/database/manager,也许您可以在这个链接上重新获取它
另一种方式是,您可以使用本地主机5432上的postgresql管理器访问数据库。

程序源代码位于插件/模块名称字典中。


我希望这对您有用。

发生的事情是,Odoo在回滚模板时损坏了数据库。 大多数表都丢失了主键

为了再次设置它们,我在一个工作实例上执行了以下代码,以获得主键列表:

select tc.table_schema, tc.table_name, kc.column_name, kc.constraint_name
from  
    information_schema.table_constraints tc,  
    information_schema.key_column_usage kc  
where 
    tc.constraint_type = 'PRIMARY KEY' 
    and kc.table_name = tc.table_name and kc.table_schema = tc.table_schema
    and kc.constraint_name = tc.constraint_name
order by 1, 2;
然后我从损坏的数据库中导出了故事列表:

select table_name from information_schema.tables;
我在excel中对此进行了匹配,并构建了一个要执行的查询列表,以再次获取主键:

="ALTER TABLE "&B15&" ADD PRIMARY KEY ("&C15&");"`enter code here`
其中B是包含表的列,C是包含主键字段名的列。 这提供了一系列SQL查询,如下所示:

ALTER TABLE product_template ADD PRIMARY KEY (id);
ALTER TABLE product_ul ADD PRIMARY KEY (id);
ALTER TABLE product_uom ADD PRIMARY KEY (id);
ALTER TABLE product_uom_categ ADD PRIMARY KEY (id);
...

我们可以直接在数据库上执行。我重新启动了Odoo和voilá。

发生的是,Odoo在回滚模板时损坏了数据库。
ALTER TABLE res_users ADD PRIMARY KEY (id);
大多数表都丢失了主键

为了再次设置它们,我在一个工作实例上执行了以下代码,以获得主键列表:

select tc.table_schema, tc.table_name, kc.column_name, kc.constraint_name
from  
    information_schema.table_constraints tc,  
    information_schema.key_column_usage kc  
where 
    tc.constraint_type = 'PRIMARY KEY' 
    and kc.table_name = tc.table_name and kc.table_schema = tc.table_schema
    and kc.constraint_name = tc.constraint_name
order by 1, 2;
然后我从损坏的数据库中导出了故事列表:

select table_name from information_schema.tables;
我在excel中对此进行了匹配,并构建了一个要执行的查询列表,以再次获取主键:

="ALTER TABLE "&B15&" ADD PRIMARY KEY ("&C15&");"`enter code here`
其中B是包含表的列,C是包含主键字段名的列。 这提供了一系列SQL查询,如下所示:

ALTER TABLE product_template ADD PRIMARY KEY (id);
ALTER TABLE product_ul ADD PRIMARY KEY (id);
ALTER TABLE product_uom ADD PRIMARY KEY (id);
ALTER TABLE product_uom_categ ADD PRIMARY KEY (id);
...
我们可以直接在数据库上执行。我重新启动了奥多和沃拉

ALTER TABLE res_users ADD PRIMARY KEY (id);
我也有同样的问题,我用一种简单的方法解决了它


我也遇到了同样的问题,我用一种简单的方法解决了它

,但我没有与数据库交互。我所做的唯一一件事就是在有人建议我这样做时接受模板的回滚。当时可能出了什么问题。我将尝试将主键添加到表中,然后查看。我已为res_user表添加了主键。那么wkf_转换也有同样的问题。一旦纠正,现在它报告网站菜单缺少主键。有人对我说,他解决了同样的问题。我希望这也是一个很好的解决方案。“问题是postgres仍在运行(使用:top进行测试)。解决方案:让postgres运行,当在top中使用完CPU资源后,停止控制台服务器。”不幸的是,这不适用于我的情况。我没有还原备份。但我没有与数据库交互。我所做的唯一一件事就是在有人建议我这样做时接受模板的回滚。当时可能出了什么问题。我将尝试将主键添加到表中,然后查看。我已为res_user表添加了主键。那么wkf_转换也有同样的问题。一旦纠正,现在它报告网站菜单缺少主键。有人对我说,他解决了同样的问题。我希望这也是一个很好的解决方案。“问题是postgres仍在运行(使用:top进行测试)。解决方案:让postgres运行,当在top中使用完CPU资源后,停止控制台服务器。”不幸的是,这不适用于我的情况。我没有恢复备份。