Odoo Help


Is there a way to hide buttons on a form when the form is in view mode? [Closed]

AJ Schrafel Paper Corp
on 6/26/13, 3:24 AM 2,407 views

The Question has been closed

AJ Schrafel Paper Corp
on 06/26/2013 16:52:18

I want to make is so that buttons in the form are not visible if the user is not editing the record.

What can I add to the XML to make a button in a form invisible if the user is not editing the record in form view?

--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 6/26/13, 4:47 AM

Hello, you can add attribute to the button field

<button name = "name" type = "type" string = "string" class = "oe_edit_only"/>

I hope it'll work for you...


Ahmed I use the Same code but not working, Here my code for ur reference .... <xpath expr="/form/header/button[@name='case_mark_won']" position="after"> <button name="case_mark_lost" string="Mark Lost" type="object" states="draft,open" class="oe_edit_only"/> </xpath>

on 8/6/13, 6:38 AM

Hi, I have a similar code and it works fine... <xpath expr = "/form/header"> <button name = "compute_flight" string = "Compute" type = "object" class = "oe_highlight, oe_edit_only" states = "draft"/> ...

Ahmed M.Elmubarak
on 8/12/13, 5:34 AM
Ali Ravani
On 6/26/13, 4:36 AM

<button name="create" invisible="1"/>

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 6/26/13, 3:24 AM
Seen: 2407 times
Last updated: 3/16/15, 8:10 AM