i am creating a new website form
in that i have 2 many2many fields with multiple selections i wanna use many2many_tags widget but i am not able to use it please help me guys how do i use that widget.
my xml code:
<div t-if="user_id.sudo().is_student" class="row col-md-12">
<div class="col-md-2 mt8">
<lable for="compulsory_subject_ids">Compulsory Subjects:</lable>
</div>
<div class="col-md-10" style="padding-left: 5px;">
<select class="form-control "
name="compulsory_subject_ids" multiple="True" >
<t t-foreach="student_id" t-as="course">
<t t-foreach="course.course_id.subject_ids" t-as="subject">
<option t-att-value="subject.id">
<t t-esc="subject.name"/>
</option>
</t>
</t>
</select>
</div>
</div>
<div t-if="user_id.sudo().is_student" class="row mt8 col-md-12">
<div class="col-md-2 mt8">
<lable for="elective_subject_ids">Elective Subjects:</lable>
</div>
<div class="col-md-10" style="padding-left: 5px;">
<select class="form-control " name="elective_subject_ids"
required="1">
<t t-foreach="subjects" t-as="subject">
<t t-if="subject.subject_type == 'elective'">
<option t-attf-value="subject.id">
<t t-esc="subject.name"/>
</option>
</t>
</t>
</select>
</div>
</div>