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

For portal user i want the list of field values appear based on the value chosen by this portal user for example :

If this portal user chooses the country, only institutions in the selected country must appear in the list of institutions  field

My code in Qweb:

 <div t-attf-class="form-group #{error.get('country_id') and 'o_has_error' or ''} col-xl-6">
<label class="col-form-label" for="country_id">Country</label>
<select name="country_id" t-attf-class="form-control #{error.get('country_id') and 'is-invalid' or ''}">
<option value="">Country...</option>
<t t-foreach="countries or []" t-as="country">
<option t-att-value="country.id" t-att-selected="country.id == int(country_id) if country_id else country.id == partner.country_id.id">
<t t-esc="country.name" />
</option>
</t>
</select>
</div>


<div t-attf-class="form-group #{error.get('institution_id') and 'o_has_error' or ''} col-xl-6">
<label class="col-form-label label-optional" for="institution_id">Health Center</label>
<select name="institution_id" t-attf-class="form-control #{error.get('institution_id') and 'is-invalid' or ''}">
<option value="">select...</option>
<t t-foreach="institutions or []" t-as="institution">
<option t-att-value="institution.id" t-att-country_id="institution.country_id.id" >
<t t-esc="institution.name" />
</option>
</t>
</select>
</div>
 
아바타
취소
관련 게시물 답글 화면 활동
1
3월 22
4527
1
10월 20
6094
0
2월 21
3462
0
3월 21
3975
1
5월 20
7461