在树视图中添加按钮Odoo 8

时间:2016-09-10 08:10:16

标签: odoo-8 odoo

我在树视图模式下创建了一个向导,只想添加一些按钮,有没有办法在odoo 8中使用它?

由于

3 个答案:

答案 0 :(得分:4)

是的,您可以在树视图中添加按钮,就像在表单视图中添加一样。

<tree string="My Tree">
   <button name="%{action_wiz_open}d" string="Scrap Products" type="action" icon="terp-gtk-jump-to-ltr" help="calls window action" />
   <button name="call_function" string="Process" type="object" help="calls python function" />
</tree>

希望这有帮助!

答案 1 :(得分:1)

要在树状视图中添加按钮,请尝试以下代码:

 <tree>
    <button name="your_action" icon="rupee-symbol"
                    String="Payment" type="action"
                    attrs="{'invisible':[('status','!=','Confirmed')]}" />
</tree>

希望它会帮助你..

答案 2 :(得分:0)

创建文件夹向导

将有

           /** merge mechanism */
            realm.where(Contact.class)
                    .equalTo("isBeingSaved", false)
                    .findAll()
                    .deleteAllFromRealm(); // delete all non-saved data
            for(Contact contact : realm.where(Contact.class).findAll()) {
                contact.setIsBeingSaved(false);
            }

在旁边添加你的功能

在file_name_view.xml中

__init__.py
file_name.py
file_name_view.xml


In Python file_name.py

def fields_view_get(self, cr, uid, view_id=None, view_type='form',
                        context=None, toolbar=False, submenu=False):
        if context is None:
            context={}
        res = super(class_name_wizard, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
        return res

注意:在 src_model 中写入树视图的表名

希望这会对你有所帮助

相关问题