odoo - OpenERP TreeView

标签 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>

最佳答案

您使用的选项适用于字段而不是树标记。所以你的 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>

关于odoo - OpenERP TreeView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21434480/

相关文章:

javascript - Odoo POS 收据需要在收据中添加来自 res.partner city 的地址

python-3.x - Odoo 12 - 生成并下载 CSV 文件

python - 将product.product字段添加到product.template View - Odoo v8

python - 更新从公共(public)到用户的 Odoo 网站路由时出现内部错误

python - 在 OpenERP 中隐藏侧边栏按钮

python - 如何使用额外的 pip 包正确扩展基本 odoo docker 镜像?

javascript - 如何在 JavaScript 中创建按钮?并使用 OpenERP 方法的按钮?

python - 如何在 Odoo 9 的 qweb 模板中的 t 字段中使用 OR 条件?

python - (代码)OpenERP v7中product.product中的id是什么?

odoo - 如何显示计算出的 one2many 字段 Odoo(api v8)