xml – 树视图头内部使用js和python添加odoo 8中的下拉菜单

树视图标题内部使用js和 python添加odoo 8中的下拉菜单

我用的是odoo-8.我的问题是如何使用JS和python在odoo8中的树视图上方添加下拉菜单.

我想在此下拉菜单中动态显示所有类别的产品.

当我点击特定类别时,树视图内部排序特定可点击类型的产品.

Suppose click on the Mobile category from drop-down menu so tree view inside show only Mobile types of products.

就像我在下图中给出的例子,

enter image description here

我想完全解决这个问题.
注意:如果有任何疑问请评论.

解决方法

您必须在template.xml代码中使用t-extend.

ControlPanel是放置在树视图上方的控制面板的模板名称.

在template.xml代码添加代码.

<t t-name="your_template_name" t-extend="ControlPanel">
    <t t-jquery=".o_cp_right" t-operation="after">
        <-- Add your Drop down list here -->
    </t>
</t>

o_cp_right是一个类,之后您可以添加下拉字段.您可以根据您的要求将t-operation设置为append,inner,after,replace.

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念