Wednesday, 12 October 2016

How to remove save button from odoo form view

In this post you will learn how to hide or remove "Save" button from Odoo form view. Some time we want to create a form view to only show or display data not to save or edit it. So here we need to hide or remove the save button. In the below screen shot you can see the "Save" button which we need to hide.

1<record model="ir.ui.view" id="form_view_unique_id">
2            <field name="name">name.of.form.view</field>
3            <field name="model"></field>           
4            <field name="arch" type="xml">
5                <form string="Form Name" create="false"  >
6                    <sheet>
7                        <group>
9                       </group>
10                    </sheet>
11                </form>
12            </field>

Code Description:
To hide "Save" button we only need to add (create="false") as we added in our code in line no 5. In the below screen shot you can see there is no "Save" button.