Odoo Help


Odoo hide show button on function call

ahmed khakwani
on 1/7/16, 6:55 AM 1,425 views

I am new to odoo and python. I am working on a module, I need to hide a button by calling a method from ".xml" file, function definition and body is in ".py" file. Currently am trying to hide button like that

<button confirm="Are you sure you want to start the test?" name="set_to_test_inprogress" states="Invoiced" string="Start Test" type="object" class="oe_highlight"groups="oehealth.group_oeh_medical_physician,oehealth.group_oeh_medical_manager" attrs="{'invisible': [('start_button', '=', False)]}"/>

and "start_button" column is in ".py" file with code like that

def _start_test_button(self, cr, uid, ids, field_name, arg, context):

return False

_columns = {

'start_button': fields.function(_start_test_button, type="boolean", obj="generic.request", method=True),


and that python code is in class named "OeHealthLabTests". When create a lab it shows error which is

Uncaught Error: Unknown field start_button in domain [["start_button","=",false],["state","not in",["Invoiced"]]]

Am confused and i didn't find a way yet to make it happen. Please guide me how can i do that.

Thank You

Andre de Kock
On 1/11/16, 7:56 AM

Good day. Because the field start_button doesn't exist on the *form* view (even though it does exist in Python and in the database), Odoo will throw that error: "Unkown field start_button..." The solution is to add the field to the form view like so:

<field name="start_button" />

If you don't want anybody to see the field, just add the invisible attribute like so:

<field name="start_button" invisible="1" />

ahmed khakwani
On 1/11/16, 8:24 AM

Thank You @Andre. As i mentioned in my previous message that i am totally new to python and odoo, i have 2 more questions.

1. Are there any video tutorials for beginners on odoo development, if yes then please send me link

2. I installed odoo source on my local system using these instructions http://www.mindissoftware.com/2014/09/08/Odoo-PyCharm-Windows-installation/ , and i purchased "oeHealth" odoo module. When i install or upgrade that module it takes too much time (approx 30 minutes), is there any other way to upgrade that module ?

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/7/16, 6:55 AM
Seen: 1425 times
Last updated: 1/29/16, 5:30 AM