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