Odoo Help


how to make a button only exist when the user editing the record?

willie ho
on 1/28/15, 9:07 PM 573 views

For some reason, I need to put a button inside the form and make it ONLY exist when the user editing it.

what should I put inside the button?


Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
| 5 5 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 1/28/15, 11:47 PM

Try using class="oe_edit_only"

<button name="button_dummy"
        states="draft,sent" string="(update)" type="object" class="oe_edit_only oe_link"/>




| 5 3 6
Jakarta, Indonesia
On 1/28/15, 10:28 PM

Try attrs with the following domain: [('id', '>', 0)].  First you need to redefine id column and put it in the form view (with invisible = True if you don't want the field to show).

You can also try to add create="false" as the button's attribute.

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

1 follower(s)


Asked: 1/28/15, 9:07 PM
Seen: 573 times
Last updated: 3/16/15, 8:10 AM