Odoo Help


This community 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.


Change button call using attributes

Atchuthan - Technical Consultant, Sodexis Inc
on 1/21/15, 6:00 AM 1,826 views

This XML view WORKS FINE but need to use attributes instead of replace

        <record model="ir.ui.view" id="stock_view_picking_out_form_print_button_inherit">
            <field name="name">stock.picking.out.form.button</field>
            <field name="model">stock.picking.out</field>
            <field name="inherit_id" ref="delivery.view_delivery_order_inherit_stock" />
            <field name="arch" type="xml">
                <xpath expr="//button[@string='Print Delivery Order']"
                    position="replace" />
                <xpath expr="//button[@string='Print Delivery Order']"
                    <button name="%(stock_picking_webkit.webkit_delivery_order)d"
                        string="Print Delivery Order" states="confirmed,assigned" type="action" />
                    <button name="%(stock_picking_webkit.webkit_delivery_order)d"
                        string="Print Delivery Order" states="done" type="action" class="oe_highlight" />

I tried using ref and eval but it doesn't work, help me with this.

 <!-- NOT WORKING -->

                <xpath expr="//button[@string='Print Delivery Order']" position="attributes">
                    <attribute name="name" ref="stock_picking_webkit.webkit_delivery_order"/>
                <xpath expr="//button[@string='Print Delivery Order']" position="attributes">
                    <attribute name="name" eval="%(stock_picking_webkit.webkit_delivery_order)d"/>



| 5 3 6
Jakarta, Indonesia
On 1/21/15, 7:21 AM

Have you tried setting it as a string: <attribute name="name">%(stock_picking_webkit.webkit_delivery_order)d</attribute>?  The evaluation part will be done after the fact.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


Asked: 1/21/15, 6:00 AM
Seen: 1826 times
Last updated: 7/10/15, 3:59 AM