Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

3

can we hide create/edit button of form view? [Closed]

By
jamesbale
on 5/13/13, 10:40 AM 16,586 views

The Question has been closed for reason: duplicate question

by
Sudhir Arya (SA)
on 05/24/2013 04:42:00

Can we hide create/edit button of form view using attrs?

11

Andreas Maertens

--Andreas Maertens--
912
| 5 5 7
Finsterwalde, Germany
--Andreas Maertens--

I develop odoo8.0 modules

Andreas Maertens
On 5/14/13, 4:09 AM

Yes you can!

You can remove the Create Button by adding attributes to your form in view.xml file:

<record ...>
    ...
    <form string="NAMEOFFORM" create="false" edit="false" version="7.0">
        ...
    </form>
</record>

This way "Edit" and "Create" are removed from view for all Users.

In case you inherit from an existing view:

    <record>
        ...
        <field name="arch" type="xml">
            <xpath expr='//form[@string="Product"]' position='attributes'>
                <attribute name="create">false</attribute>
            </xpath>
        </field> ,
    </record>

im doing like this but the save button does not disable!!!!!!!!!: <record id="view_statistic_cloud_form_methode" model="ir.ui.view"> <field name="name">My First Form view</field> <field name="model">cloud.statistic</field> <field name="type">form</field> <field name="arch" type="xml"> <form string="My First Form View" version="7.0" create="false" > <group col="4"> <field name="meter"/> <field name="Max"/> <field name="Name"/> </group> </form> </field> </record>

Hachem Chraiti
on 4/17/14, 7:00 AM

Also, with something like this It's possible to hide the buttons from an specific user groups. In this example hide the buttom edit in the Invoice Form. The users of the groups have write privileges only for posting on the messages an communication history but not the fields of the invoices. account.invoice.form account.invoice <xpath expr="//form[@string='Invoice']" position="attributes"> false

OSSE - Oficina de Soluciones y Servicios Empresariales, jolevq
on 4/27/16, 10:20 PM
6

Sandeep

--Sandeep--
6083
| 6 5 8
Delhi, India
--Sandeep--
Python OpenERP Developer http://in.linkedin.com/pub/sandeep-rana/3b/a16/786/
Sandeep
On 5/13/13, 10:42 AM

Hi yes, you can do that ,

you can via access right for specific user

and

in view for all user

like this

   <form create="false" edit="false" >

Thanks
sandeep

tanks for your help

jamesbale
on 5/13/13, 10:55 AM

not working

muhammed
on 4/12/14, 1:35 AM
2

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 5/24/13, 4:41 AM

This is a duplicate question. See original question: How to remove Save/Edit button

This could also help you: How to remove delete icon in one2many tree view

2

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 5/24/13, 3:15 AM

Hello Jamesbale,

You can use create="false" attribute in form tag. It will disable Create button from form view. You can use edit="false" to disable Edit button.

If you want to disable button from form view then use this:

<form create="false" edit="false">

Thanks.

how to hide the edit button according the status . I want to hide the edit button if status is 'done'

Aneesh
on 6/5/13, 3:06 AM

HI @Aneesh do you discover how to hide the button if depending on state and a groups(depending on permissions) ? Thanks

Versão Integral, Anabela Damas
on 7/1/13, 9:00 AM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 5/13/13, 10:40 AM
Seen: 16586 times
Last updated: 4/21/16, 5:36 AM