Odoo Help


How to create a button for every row in view tree

Pau Ubach
on 9/23/14, 3:18 AM 2,360 views

I'm trying to create a tree view with a button and I'm totally lost. Following some examples I arrived to dessign this view:


<record model="ir.ui.view" id="pricelist_getter_tree">
            <field name="name">pricelist_getter_tree</field>
            <field name="model">bdd.pricelist</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Price List">
                    <field name="cus_name"/>
                    <field name="pr_name"/>
                    <field name="pl_amount"/>
                    <field name="pl_speed"/>
                    <field name="pl_hard"/>
                    <field name="pl_setup_price"/>
                    <field name="price_min"/>
                    <field name="pl_profitrate"/>
                    <field name="pl_salescom"/>
                    <field name="pl_price"/>
                    <field name="pl_revenue"/>
                    <button string="Transfer" icon="gtk-redo" name="transfer" type="action"/>
                    <!-- field name="pl_currency"/-->


But I'm getting an error:

Uncaught TypeError: Cannot read property 'tree_invisible' of undefined


Any suggestion or guidelines about how to do it? Google isn't helping me much.


Do you use tree_invisible attribute somewhere? And are you sure "pr_name" is correct? I feel like it doesn't follow used naming convention.

Ben Bernard
on 9/23/14, 4:47 AM

Thanks, No, tree_invisible is not anything mine. And yes, pr_name is correct. Everything is OK until I add the button.

Pau Ubach
on 9/23/14, 4:54 AM

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
| 5 5 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 9/23/14, 3:59 AM

Try this

<button string="Transfer" icon="gtk-redo" name="transfer" type="object"/>

A button can be triggered by various methods:
1. Object
2. Action
3. Workflow (Default)


When using type="action", the name should have the action id with it. i.e. name="%(module.action_id)d"

Thanks atchuthan, but I get the same error with object.

Pau Ubach
on 9/23/14, 4:14 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 9/23/14, 3:18 AM
Seen: 2360 times
Last updated: 3/16/15, 8:10 AM