Odoo Help


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.


6.1 Trouble with readonly buttons in attrs

Grahame Jordan
on 7/18/13, 6:18 AM 1,227 views


I have a custom application in that in some cases I require the fields to be readonly depending on who is logged in. I have created a function field so see if the user is admin or manager.

'am_i_the_manager': fields.function(_am_i_the_manager, string='Am I The Manager?', arg="manager", type='boolean'),

<button name="button_approve" colspan="1" string="Accept" type="object" icon="gtk-apply" attrs="{'invisible':[('state','!=','approval')], 'readonly':['|', ('am_i_the_manager','=',False),('state','!=','approval')]}" help="Accept and approve"/>

However when the form is in readonly mode the button is still active. If the filed is any other type it is behaving as readonly. Are buttons supposed to do this?

Did you try first with Readonly (Check the case). And try to integrate the conditions in the attrs field

Mind & Go, Mind And Go
on 11/15/13, 5:14 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

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

Question tools

0 follower(s)


Asked: 7/18/13, 6:18 AM
Seen: 1227 times
Last updated: 3/16/15, 8:10 AM