SmithMcPatrick
SmithMcPatrick

Reputation: 619

OpenERP - How I can remove Save button and Discard link from my view?

How I can remove Save button and Discard link from my view? I have created very simple view but the Save and Discard buttons are there by default. Please see the picture.

enter image description here

Upvotes: 3

Views: 5579

Answers (4)

Hari Prasanth
Hari Prasanth

Reputation: 88

You can easily hide by adding the simple style below in XML.

<form>
    <style>
       header{
          display:none !important;
       }
       footer{
          display:none !important;
       }
    </style>
</form>

Thanks

Upvotes: 0

Pawan Kumar Sharma
Pawan Kumar Sharma

Reputation: 1168

You can easily hide by adding simple below jquery script in xml.

<form>
    <script>
        $(document).ready(function(){
        $(".modal-header").hide();
        $(".modal-footer").hide();
        });
    </script>
    <group col="4" colspan="4">

Thanks

Upvotes: 1

strike_noir
strike_noir

Reputation: 4174

In your ir.actions.act_window xml record, add this line

<field name="target">inline</field>

I know this is an old question. Just in case someone googled this question and stumble across this.

Upvotes: 6

C&#233;sar
C&#233;sar

Reputation: 10119

This is actually pretty easy to accomplish.

If you want to hide the buttons Create and Import in a Tree View, use create="false" in the tree tag definition:

<record id="your_id" model="ir.ui.view">
    <field name="name">your.model.tree</field>
    <field name="model">your.model</field>
    <field name="arch" type="xml">
        <tree string="Your model" create="false">
                <!-- Your fields-->
        </tree>
    </field>
</record>

If you want to hide the buttons Save, Edit and Discard in a Form View, use create="false" and edit="false" in the form tag definition:

<record id="your_id" model="ir.ui.view">
    <field name="name">your.model.form</field>
    <field name="model">your.model</field>
    <field name="arch" type="xml">
        <form string="Your model" create="false" edit="False">
            <!-- Your fields -->
        </form>
    </field>
</record>

Upvotes: 3

Related Questions