コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
5071 ビュー

I'm trying to manipulate the sale form by a module with inheritance in views. I have following XML for testing:

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="view_order_form" model="ir.ui.view">
            <field name="name">sale.order.form.custom.120</field>
            <field name="model">sale.order</field>
            <field name="inherit_id" ref="sale.view_order_form"/>
            <field name="arch" type="xml">
                <data>
                    <field name="invoiced" position="replace"/>
                    <xpath
                        expr="//page[@string='Order Line']/field[@name='product_uom_qty']" 
                        position="replace">
                    </xpath>
                </data>
            </field>
        </record>
    </data>
</openerp>

AFAIK that should remove the quantity field from the form. But it won't.

I tested the XPath expression wit a query tool. Should be fine.

Is there any debug/trace level to see what happens, when reading this XML to update the view ?

(Updates removed, as incorrect)

アバター
破棄
最善の回答

We had some issues with sale order view customizations not showing up properly and it was because of the loading order between sale, sale_stock and the custom modules. Setting the custom modules to depend on sale_stock instead of sale fixed the issue. Perhaps your issue is related if you currently have sales and warehouse management functionalities installed.

アバター
破棄
著作者

You were right, in my case sale_layout puts the field again into the form.

最善の回答

Hello Peterm,

Your xpath seems wrong.

Try this xpath:

<xpath expr="//notebook/page[@string='Order Lines']/field[@name='order_line']/tree/field[@name='product_uom_qty']" position="replace"></xpath>
<xpath expr="//notebook/page[@string='Order Lines']/field[@name='order_line']/form/group/group/label[@for='product_uom_qty']" position="replace"></xpath>
<xpath expr="//notebook/page[@string='Order Lines']/field[@name='order_line']/form/group/group/div/field[@name='product_uom_qty']" position="replace"></xpath>

Then update your module.

Hope this will solve your problem.

Thanks,

Serpent Consulting Services.

アバター
破棄
著作者

None of them works for me. So asking again, is there a trace option or where OE reads and proceses the xpath expression to add a trace there to see what happens.

What error are you facing?

著作者

Updating the module, the field keeps on the form (should be removed) as nothing was done. If I provoke an error in the XML I get an error message. That means my XML is read on update ...

関連投稿 返信 ビュー 活動
6
9月 17
8993
1
3月 15
6591
1
3月 15
4889
2
3月 15
10509
1
3月 24
10634