OpenERP树视图

时间:2014-01-29 14:49:15

标签: openerp odoo

我想将treeview标题中的一个默认值按钮替换为一个具有我的函数的函数...我尝试以这种方式使用xpath但没有工作

<field name= "types_id" colspan="8" nolabel="1">
                    <tree options='{"deletable": false, "addable":null, "isClarkGable": false}'>
                        <field name="type_id"/>        
                        <field name="fundamentation"/>    
                        <xpath expr="//tree/button[@string='Add']" position="replace">
                            <button name="button_cancel" string="Mark to Cancel" type="object" icon="gtk-cancel"/>
                        </xpath>                    
                    </tree>
                </field>

1 个答案:

答案 0 :(得分:4)

您使用的选项是字段而不是树标记。所以你的xml就像,

<field name= "types_id" colspan="8" nolabel="1" options='{"deletable": false, "addable":null}'>
     <tree delete="false" string='YOUR STRING'>
         <field name="type_id"/>
         <field name="fundamentation"/>
         <xpath expr="//tree/button[@string='Add']" position="replace">
             <button name="button_cancel" string="Mark to Cancel" type="object" icon="gtk-cancel"/>
         </xpath>
     </tree>
</field>
相关问题