Odoo Help

0

How to make Readonly Button?

By
HappyOdoo
on 5/27/15, 9:25 AM 938 views

hi ,

How to make readonly button based on condition?

I have two Button

  • Button 1

  • Button 2

 and my condition is if database filed text is "po" then allow Button 1 and filed text "os" then Button 2.

How to apply condition on button based on Database field.

hi Temur,

I already did this step attrs="{'readonly': [('field_name','=','po')]}".

it's not working dear.

HappyOdoo
on 5/29/15, 1:17 AM
0
HappyOdoo
On 6/4/15, 1:46 AM

it's not work attrs="{'readonly': [('field_name','=','po')]}" or

attrs="{'readonly': [('field_name','=','so')]}".

My button code line is

<button name="button1" states="approve" string="Button 1" type="object" attrs="{'readonly': [('field_name','=','po')]}" icon="gtk-ok" /> 

I am using openerp v5.

3
Kinner Vachhani
On 5/28/15, 10:09 AM

Best to make button invisible rather than readonly. It will save space on your view and look more user friendly. 

2
Temur
On 5/27/15, 10:16 AM

add to "Button 2" in xml:

attrs="{'readonly': [('field_name','=','po')]}" 


similar for "Button 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.

Register

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

0 follower(s)

Stats

Asked: 5/27/15, 9:25 AM
Seen: 938 times
Last updated: 8/17/15, 6:25 AM