0

当我尝试将用户菜单添加到 mu 模块并使用继承其表单视图时,出现以下错误。请建议我对这个问题进行排序。我的整个源代码上传到这里@GitHub

AttributeError: View definition error for inherited view 'bpl.view_users_inherit_form' on model 'res.users': Element '<tree string="My view">' not found in parent view 'base.view_users_form'

下面显示了我的 Eclipse 控制台中的整个错误

2013-04-16 06:44:21,114 2922 INFO bellvantage openerp.modules.loading: loading 1 modules...
2013-04-16 06:44:21,250 2922 INFO bellvantage openerp.modules.loading: loading 33 modules...
2013-04-16 06:44:21,343 2922 INFO bellvantage openerp.modules.module: module bpl: creating or updating database tables
2013-04-16 06:44:22,095 2922 INFO bellvantage openerp.modules.loading: module bpl: loading bpl_worker_registration_sequence.xml
2013-04-16 06:44:22,104 2922 INFO bellvantage openerp.modules.loading: module bpl: loading bpl_view.xml
2013-04-16 06:44:22,613 2922 WARNING bellvantage openerp.addons.base.ir.ir_ui_view: Setting the `type` field is deprecated in the `ir.ui.view` model.
2013-04-16 06:44:23,445 2922 INFO bellvantage openerp.modules.loading: module bpl: loading security/bpl_security.xml
2013-04-16 06:44:23,532 2922 ERROR bellvantage openerp.addons.base.ir.ir_ui_view: Can't render view base.user_groups_view for model: res.users
Traceback (most recent call last):
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/base/ir/ir_ui_view.py", line 125, 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 "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/osv/orm.py", line 2235, in fields_view_get
    arch=apply_view_inheritance(cr, user, source, sql_res['id']),
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/osv/orm.py", line 2193, in apply_view_inheritance
    source = apply_inheritance_specs(source, view_arch, view_id)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/osv/orm.py", line 2177, in apply_inheritance_specs
    raise_view_error("Element '%s' not found in parent view '%%(parent_xml_id)s'" % tag, inherit_id)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/osv/orm.py", line 2070, in raise_view_error
    %  (child_view.xml_id, self._name, error_msg))
AttributeError: View definition error for inherited view 'bpl.view_users_inherit_form' on model 'res.users': Element '<tree string="My view">' not found in parent view 'base.view_users_form'
2013-04-16 06:44:23,534 2922 ERROR bellvantage openerp.tools.convert: Parse error in /home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/bpl/security/bpl_security.xml:9: 
<record id="group_checkroll_user" model="res.groups">
            <field name="name">Checkroll_User</field>
            <field name="category_id" ref="module_checkroll_category"/>
        </record>
Traceback (most recent call last):
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-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 "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/base/ir/ir_model.py", line 937, in _update
    model_obj.write(cr, uid, [res_id], values, context=context)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/mail/res_users.py", line 190, in write
    write_res = super(res_groups_mail_group, self).write(cr, uid, ids, vals, context=context)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/base/res/res_users.py", line 660, in write
    self.update_user_groups_view(cr, uid, context)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/base/res/res_users.py", line 694, in update_user_groups_view
    view.write({'arch': xml_content})
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/base/ir/ir_ui_view.py", line 207, in write
    return super(view, self).write(cr, uid, ids, vals, context)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/osv/orm.py", line 4201, in write
    self._validate(cr, user, ids, context)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/osv/orm.py", line 1544, 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!')
2013-04-16 06:44:23,535 2922 ERROR bellvantage openerp.netsvc: ValidateError
Error occurred while validating the field(s) arch: Invalid XML for View Architecture!
Traceback (most recent call last):
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/netsvc.py", line 293, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/service/web_services.py", line 614, in dispatch
    security.check(db,uid,passwd)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/service/security.py", line 40, in check
    pool = pooler.get_pool(db)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/pooler.py", line 49, in get_pool
    return get_db_and_pool(db_name, force_demo, status, update_module)[1]
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/pooler.py", line 33, in get_db_and_pool
    registry = RegistryManager.get(db_name, force_demo, status, update_module)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/modules/registry.py", line 192, in get
    update_module)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/modules/registry.py", line 218, in new
    openerp.modules.load_modules(registry.db, force_demo, status, update_module)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/modules/loading.py", line 344, in load_modules
    processed = load_marked_modules(cr, graph, states_to_load, force, status, report, loaded_modules, update_module)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/modules/loading.py", line 259, in load_marked_modules
    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/modules/loading.py", line 191, in load_module_graph
    load_data(module_name, idref, mode)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/modules/loading.py", line 76, in <lambda>
    load_data = lambda *args: _load_data(cr, *args, kind='data')
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/modules/loading.py", line 127, in _load_data
    tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/tools/convert.py", line 954, in convert_xml_import
    obj.parse(doc.getroot())
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/tools/convert.py", line 847, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-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 "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/base/ir/ir_model.py", line 937, in _update
    model_obj.write(cr, uid, [res_id], values, context=context)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/mail/res_users.py", line 190, in write
    write_res = super(res_groups_mail_group, self).write(cr, uid, ids, vals, context=context)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/base/res/res_users.py", line 660, in write
    self.update_user_groups_view(cr, uid, context)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/base/res/res_users.py", line 694, in update_user_groups_view
    view.write({'arch': xml_content})
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/addons/base/ir/ir_ui_view.py", line 207, in write
    return super(view, self).write(cr, uid, ids, vals, context)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/osv/orm.py", line 4201, in write
    self._validate(cr, user, ids, context)
  File "/home/bellvantage/Documents/openerp-7.0/openerp-7/openerp/osv/orm.py", line 1544, 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!')
2013-04-16 06:44:23,540 2922 INFO bellvantage werkzeug: 127.0.0.1 - - [16/Apr/2013 06:44:23] "POST /web/dataset/call_button HTTP/1.1" 200 -
4

1 回答 1

1

问题在 bpl_view.xml 的第 804 行:

<record model="ir.ui.view" id="view_users_inherit_form">
    <field name="name">res.users.form.inherit</field>
    <field name="inherit_id" ref="base.view_users_form" />
    <field name="model">res.users</field>
    <field name="type">form</field>
</record>

删除了上面的视图并更新了我的模块。

错误由此解决。

@Arya help.openerp.com 非常感谢您的建议

于 2013-04-16T07:25:35.787 回答