我正在尝试安装名为:account banking payment export的模块。它给了我无效的XML视图架构错误。 我检查了服务器日志:
2013-11-03 07:58:38,499 14957 INFO itmeedia openerp.modules.module: module account_banking_payment_export: creating or updating database tables
2013-11-03 07:58:38,529 14957 INFO itmeedia openerp.modules.loading: module account_banking_payment_export: loading view/account_payment.xml
2013-11-03 07:58:38,544 14957 ERROR itmeedia openerp.addons.base.ir.ir_ui_view: Can't render view for model: payment.order
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 'account_pain.view_payment_order_form_inherit' on model 'payment.order': Element '<button name="set_done">' not found in parent view 'account_payment.view_payment_order_form'
2013-11-03 07:58:38,548 14957 ERROR itmeedia openerp.tools.convert: Parse error in /usr/lib/pymodules/python2.7/openerp/addons/account_banking_payment_export/view/account_payment.xml:7:
<record id="view_banking_payment_order_form_1" model="ir.ui.view">
<field name="name">account.payment.order.form.banking-1</field>
<field name="inherit_id" ref="account_payment.view_payment_order_form"/>
<field name="model">payment.order</field>
<field name="arch" type="xml">
<data>
<xpath expr="//button[@string='Make Payments']" position="attributes">
<attribute name="name">launch_wizard</attribute>
</xpath>
</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 967, in _update
res_id = model_obj.create(cr, uid, values, context=context)
File "/usr/lib/pymodules/python2.7/openerp/addons/base/ir/ir_ui_view.py", line 103, in create
return super(view, self).create(cr, uid, values, context)
File "/usr/lib/pymodules/python2.7/openerp/osv/orm.py", line 4478, in create
self._validate(cr, user, [id_new], 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!')
2013-11-03 07:58:38,548 14957 ERROR itmeedia 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 626, in dispatch
res = fn(db, uid, *params)
File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 188, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/usr/lib/pymodules/python2.7/openerp/osv/osv.py", line 144, in wrapper
raise except_osv(inst.name, inst.value)
except_osv: ('ValidateError', u'Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')
正如您所看到的,问题出在view / account_payment.xml中 文件:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- restore wizard functionality when making payments
-->
<record id="view_banking_payment_order_form_1" model="ir.ui.view">
<field name="name">account.payment.order.form.banking-1</field>
<field name="inherit_id" ref="account_payment.view_payment_order_form" />
<field name="model">payment.order</field>
<field name="arch" type="xml">
<data>
<xpath expr="//button[@string='Make Payments']"
position="attributes">
<attribute name="name">launch_wizard</attribute>
</xpath>
</data>
</field>
</record>
</data>
</openerp>
任何人都可以帮我吗?我也是XML的新手。
答案 0 :(得分:1)
我认为问题是由于另一个名为account_pain的模块造成的。如果查看此模块,在文件account_payment_view.xml中,您可以看到此模块正在使用字符串“Make Payment”替换相同的按钮。因此,如果您已经安装了模块account_pain,并且如果您尝试安装account_banking_payment_export,则会导致错误,因为模块account_pain中的“Make Payment”按钮已被替换,并且当前不在视图中。所以我建议卸载account_pain模块或更改account_pain模块以使按钮不可见而不是替换按钮。