跳至內容
選單
此問題已被標幟
1 回覆
11858 瀏覽次數

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>

頭像
捨棄
最佳答案

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.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
3月 15
3135
1
6月 23
3231
1
2月 25
12505
2
9月 24
4460
2
8月 23
2409