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

I found that a field could be made required based on the state of the record, using the state expression as follows:

'check_total': fields.float('Verification Total', digits_compute=dp.get_precision('Account'), readonly=True,  states={'draft':[('readonly',False)]}),

where this is a field in the account_invoice table

I need to extend this behavior to use any other field, how can I achieve this.


아바타
취소
베스트 답변

I don't know if it's possible on a field definition level, but on a view level it is :

<field name="default_debit_account_id" attrs="{'required':[('type','in', ('cash', 'bank'))]}" />
아바타
취소
작성자

Thx for help, it worked fine. I 'm also pleased that I'm the first one who upvoted one of your answers.

관련 게시물 답글 화면 활동
6
12월 15
14665
3
5월 25
1911
1
4월 25
1437
3
9월 24
14406
2
2월 24
2600