0
votes

I want to display the fields as editable in tree view inside a new tab in the sale.order? My code does not make any errors, but shows the fields in form view rather than tree view. How to correct it? .xml

<record model="ir.ui.view" id="contract_custom">
        <field name="name">sale.order.custom.form.inherited</field>
        <field name="model">sale.order</field>
        <field name="type">tree</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
            <field name="arch" type="xml">
                <xpath expr="//page[@string='Other Information']" position="after">
                    <page string="Salesman Commission">
                        <tree editable="bottom">
                                <group>
                                    <field name="user_select"/>
                                    <field name="sales_value" on_change="on_change_commission(sales_value,sale_percent)"/>
                                    <field name="sale_percent" on_change="on_change_commission(sales_value,sale_percent)"/>
                                    <field name="sale_commission"/>
                                </group>
                        </tree>
                    </page>
                </xpath>
            </field>
    </record>
1

1 Answers

1
votes

Here is a possible solution

<record model="ir.ui.view" id="contract_custom">
        <field name="name">sale.order.custom.form.inherited</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
            <field name="arch" type="xml">
                <xpath expr="//page[@string='Other Information']" position="after">
                    <page string="Salesman Commission">
                     <field name="field_name"> <!-- field you want to show as tree -->
                        <tree editable="bottom">
                           <field name="user_select"/>
                           <field name="sales_value" on_change="on_change_commission(sales_value,sale_percent)"/>
                           <field name="sale_percent" on_change="on_change_commission(sales_value,sale_percent)"/>
                           <field name="sale_commission"/>
                        </tree>
                      </field>
                    </page>
                </xpath>
            </field>
</record>