Odoo Help

Welcome!

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.

0

How to make Readonly Button?

By
HappyOdoo
on 5/27/15, 9:25 AM 637 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

--Temur--
2896
| 6 5 7
Tbilisi, Georgia
--Temur--
Programmer
Temur
On 5/27/15, 10:16 AM

add to "Button 2" in xml:

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


similar for "Button 1"


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)

Stats

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