Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
10515 Vizualizări

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"/-->
                </tree>
            </field>
        </record>

 

But I'm getting an error:

Uncaught TypeError: Cannot read property 'tree_invisible' of undefined

http://localhost:8069/?debug=&db=openerp_db_server&ts=1411455025018#view_type=form&model=bdd.pricelist&menu_id=827&action=1085:18

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

Thanks

Imagine profil
Abandonează

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.

Autor

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

Cel mai bun răspuns

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)

http://stackoverflow.com/questions/20897567/openerp-v7-button-action

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

Imagine profil
Abandonează
Autor

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

Related Posts Răspunsuri Vizualizări Activitate
1
mai 24
1514
1
feb. 17
5291
1
mar. 15
3984
1
mar. 15
15709
0
mar. 24
10812