This question has been flagged
1 Reply
10232 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']"
                    position="replace">
                    <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" />
                </xpath>
            </field>
        </record>

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

Avatar
Discard
Best Answer

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.

Avatar
Discard