Community: Framework mailing list archives

expert-framework@mail.odoo.com

RE: make a field on tree form readonly conditionally

by
alec
- 10/24/2016 09:40:48

Hello. You can try this:

 

 

<field name="my_field"  attrs="{'readonly':[('state','=', ' done ')]}" />

 

Another way you can try is declaring the states attribute directly on your model:

 

                my_field = fields.Char(‘My field label’, states={'done':[('readonly',True)]} )

 

 


MsC. Alexander Vinent
Desarrollo de Sistemas y Calidad de Software

DESOFT S.A. División Santiago

Móvil: + 53 53793780

Trabajo: 022-64-0661

 

 

On Fri, Oct 21, 2016 at 12:52 PM, Christian Valsecchi <christian.valsecchi@outlook.com> wrote:

Hi there,

   I’m trying to make a field on the sale order line tree form readonly, only on a particular condition.

I’ve tried the attr in the view but it doesn’t work.

 

Any idea?

 

Kind Regards,,

Christian Valsecchi