更改销售模块视图,树木串,名称,按钮名称

时间:2013-12-04 05:38:33

标签: python xml xpath view openerp

我需要更改treeview openerp's sale模块,tree strings quotationsale 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 ServiciosSale Order Compra de Servicios

2 个答案:

答案 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>