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

Hello does anyone have any idea or doc about return the attr like : invisible or required from on_change function?

아바타
취소
베스트 답변

You can do it the following (indirect) way:

  • Use a hidden boolean field flag
  • For the field you want to set required or invisible use attrs="{'invisible': [('flag','=',True)]}"
  • In the on_change function you can now return the value for flag
아바타
취소
작성자

Thank you Andre, but the field flag gonna save in database right?, and could we have another solution like return context or domain...?

Nice suggestion :)