Search code examples
odooodoo-12

Odoo: How to remove notebook pages in sales order


How do i remove or modify these notebook pages in sales order, i searched for them in addons/sale/views/sale_views.xml but didn't find them

enter image description here


Solution

  • You should not remove the pages from the form view because it is inherited from other views also.

    Instead, you can make it invisible by inheriting the view_order_form of sale.

           <record id="view_order_form_inherit" model="ir.ui.view">
                <field name="name">sale.order.form</field>
                <field name="model">sale.order</field>
                <field name="inherit_id" ref="sale.view_order_form"/>
                <field name="priority">20</field>
                <field name="arch" type="xml">
                    <xpath expr="//page[@name='other_information']" position="attributes">
                        <attribute name="invisible">1</attribute>
                    </xpath>
                    <xpath expr="//page[2]" position="attributes">
                        <attribute name="invisible">1</attribute>
                    </xpath>
                </field>
            </record>
    

    Hope this helps!