启动OpenERP 7时出现“无法渲染视图”错误

时间:2014-02-17 15:13:51

标签: openerp openerp-7

我的生产数据库中出现以下错误,拒绝登录。我需要有关如何解决它的建议。

2014-02-15 22:42:24,733 18124 ERROR myDB openerp.addons.base.ir.ir_ui_view: Can't render view project_issue.view_project_form_inherited for model: project.project
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_ui_view.py", line 126, in _check_render_view
    fvg = self.pool.get(view.model).fields_view_get(cr, uid, view_id=view.id, view_type=view.type, context=context)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2239, in fields_view_get
    arch=apply_view_inheritance(cr, user, source, sql_res['id']),
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2197, in apply_view_inheritance
    source = apply_inheritance_specs(source, view_arch, view_id)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2181, in apply_inheritance_specs
    raise_view_error("Element '%s' not found in parent view '%%(parent_xml_id)s'" % tag, inherit_id)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 2074, in raise_view_error
    %  (child_view.xml_id, self._name, error_msg))
AttributeError: View definition error for inherited view 'project_issue.view_project_form_inherited' on model 'project.project': Element '<xpath expr="//page[@name="project_stages"]">' not found in parent view 'project.edit_project'
2014-02-15 22:42:24,739 18124 ERROR myDB openerp.tools.convert: Parse error in /usr/lib/pymodules/python2.7/openerp/addons/project_issue/project_issue_view.xml:302: 
<record id="view_project_form_inherited" model="ir.ui.view">
            <field name="name">project.project.form.inherited</field>
            <field name="model">project.project</field>
            <field name="inherit_id" ref="project.edit_project"/>
            <field name="arch" type="xml">
                <data><xpath expr="//div[@name=&quot;options_active&quot;]" position="inside">
                    <field name="use_issues" class="oe_inline"/>
                    <label for="use_issues"/>
                </xpath>
                <xpath expr="//div[@name=&quot;buttons&quot;]" position="inside">
                    <button name="%(act_project_project_2_project_issue_all)d" string="Issues" type="action" attrs="{'invisible':[('use_issues','=', 0)]}"/>
                </xpath>
                <xpath expr="//page[@name=&quot;project_stages&quot;]" position="attributes">
                    <attribute name="attrs">{'invisible': [('use_tasks', '=', False),('use_issues','=',False)]}</attribute>
                </xpath>
                <field name="priority" position="before">
                    <field name="project_escalation_id"/>
                </field>
                <field name="alias_domain" position="after">
                    <label for="alias_model" class="oe_edit_only" string="creates"/><field name="alias_model" class="oe_edit_only oe_inline"/>
                </field>
            </data></field>
       </record>
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/usr/lib/pymodules/python2.7/openerp/tools/convert.py", line 814, in _tag_record
    id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
  File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_model.py", line 940, in _update
    model_obj.write(cr, uid, [res_id], values, context=context)
  File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_ui_view.py", line 214, in write
    return super(view, self).write(cr, uid, ids, vals, context)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4209, in write
    self._validate(cr, user, ids, context)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 1548, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
2014-02-15 22:42:24,743 18124 ERROR myDB openerp.netsvc: ValidateError
Error occurred while validating the field(s) arch: Invalid XML for View Architecture!
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 433, in dispatch
    return fn(*params)
  File "/usr/lib/pymodules/python2.7/openerp/service/web_services.py", line 444, in exp_authenticate
    res_users = pooler.get_pool(db).get('res.users')
  File "/usr/lib/pymodules/python2.7/openerp/pooler.py", line 49, 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)
  File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 192, in get
    update_module)
  File "/usr/lib/pymodules/python2.7/openerp/modules/registry.py", line 218, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 350, in load_modules
    force, status, report, loaded_modules, update_module)
  File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 256, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 188, in load_module_graph
    load_data(module_name, idref, mode)
  File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 76, in <lambda>
    load_data = lambda *args: _load_data(cr, *args, kind='data')
  File "/usr/lib/pymodules/python2.7/openerp/modules/loading.py", line 124, in _load_data
    tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
  File "/usr/lib/pymodules/python2.7/openerp/tools/convert.py", line 954, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/pymodules/python2.7/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/usr/lib/pymodules/python2.7/openerp/tools/convert.py", line 814, in _tag_record
    id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )
  File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_model.py", line 940, in _update
    model_obj.write(cr, uid, [res_id], values, context=context)
  File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_ui_view.py", line 214, in write
    return super(view, self).write(cr, uid, ids, vals, context)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4209, in write
    self._validate(cr, user, ids, context)
  File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 1548, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

2 个答案:

答案 0 :(得分:0)

AttributeError: View definition error for inherited view 'project_issue.view_project_form_inherited' on model 'project.project': Element '<xpath expr="//page[@name="project_stages"]">' not found in parent view 'project.edit_project'

你收到了错误信息。似乎“project_issue”模块出了问题。也许某些东西没有正确安装。因此,尝试使用--update = all或--update =项目启动服务器,这可能有所帮助。

如果没有,请尝试在数据库中卸载所提到的模块(project_issue或/和project)。你可以在ir_module_module列状态下执行此操作。希望您可以在此之后登录并进一步搜索。

您是否使用影响项目模块的自制模块?如果是这样,也许有一个大问题(只需用上面的方法卸载它)。

答案 1 :(得分:0)

似乎是您的代码中的错误。只需删除<data>标记,因为它位于错误的位置。 你的观点应该是这样的。

 <record id="view_project_form_inherited" model="ir.ui.view">
        <field name="name">project.project.form.inherited</field>
        <field name="model">project.project</field>
        <field name="inherit_id" ref="project.edit_project"/>
        <field name="arch" type="xml">
            <xpath expr="//div[@name='options_active']" position="inside">
                <field name="use_issues" class="oe_inline"/>
                <label for="use_issues"/>
            </xpath>
            <xpath expr="//div[@name='buttons']" position="inside">
                <button name="%(act_project_project_2_project_issue_all)d" string="Issues" type="action" attrs="{'invisible':[('use_issues','=', 0)]}"/>
            </xpath>
            <xpath expr="//page[@name='project_stages']" position="attributes">
                <attribute name="attrs">{'invisible': [('use_tasks', '=', False),('use_issues','=',False)]}</attribute>
            </xpath>
            <field name="priority" position="before">
                <field name="project_escalation_id"/>
            </field>
            <field name="alias_domain" position="after">
                <label for="alias_model" class="oe_edit_only" string="creates"/><field name="alias_model" class="oe_edit_only oe_inline"/>
            </field>
        </field>
   </record>

试试这个。不要忘记更新您的模块。希望这会对你有所帮助。