콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
5663 화면

Hi all,

I am new to Odoo and using version 12 for learning.

I have a form with 2 fields.  Field_1 and Field_2.

I want to make "Field_2" readonly if Field_1 is not filled.

How can I achieve that?

Thank you in advance

Best regards


아바타
취소

This Odoo customization tips will helps you: http://learnopenerp.blogspot.com

베스트 답변

Hi,

Simply what you can do is that use attributes, take the case of field_1 and field_2.

In the XML, you can define the field_2 like this, so that the field_2 will be read-only until there is a value in field_1.


<field name="field_2" attrs="{'readonly':[('field_1','=',False)]}"/>


Thanks

아바타
취소
작성자

Thank you Cybrosys, works like a charm. Regards

관련 게시물 답글 화면 활동
5
9월 19
6394
1
10월 24
3147
3
10월 23
9018
1
9월 23
3416
1
5월 23
2387