我需要更改treeview
openerp's
sale
模块,tree strings
quotation
和sale order
为实现这一目标,我正在制作一个全新的模块( init _openerp_和view.xml文件)
我会继承view
,然后用xpath
覆盖名称问题,我仍然无法完成它,它给了我一个
ERROR:RELAXNGV:RELAXNG_ERR_ELEMWRONG: Did not expect element record there
我的代码是:
<record id="view_quotation_tree" model="ir.ui.view" >
<field name="name">sale.order.tree.inherit</field>
<field name="model">sale.order</field>
<field name="type">tree</field>
<field name="inherit_id" ref="sale.view_quotation_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree[@string='Quotation']" position="replace">
<tree string="Servicios" fonts="bold:message_unread==True" colors="grey:state=='cancel';blue:state in ('waiting_date','manual');red:state in ('invoice_except','shipping_except')">
</tree>
</xpath>
</field>
非常感谢任何帮助,
提前致谢!
编辑:
我需要更改例如Quotation
的标题Solicitud de Servicios
或Sale Order
Compra de Servicios
。
答案 0 :(得分:2)
使用,
<record id="view_quotation_tree" model="ir.ui.view" >
<field name="name">sale.order.tree.inherit</field>
<field name="model">sale.order</field>
<field name="type">tree</field>
<field name="inherit_id" ref="sale.view_quotation_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree[@string='Quotation']" position="attributes">
<attribute name="string">Servicios</attribute>
</xpath>
</field>
答案 1 :(得分:1)
不要替换tree.try position ='attributes'
<xpath expr="/tree[@string='Quotation']" position="attributes">
<attribute name="string">Servicios</attribute>
</xpath>