Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
10103 มุมมอง

Hello Guys!!

Wouldanyone help me know please a solution to this problem:

I have an input in my qweb template :

<input t-if="!widget.get('effective_readonly')" class="oe_timesheet_weekly_input" t-att-data-project="project.project"  t-att-data-day-count="day_count" type="text"/>

Now i want to change this input to a selection like above :

                            <select t-if="!widget.get('effective_readonly')" class="oe_timesheet_weekly_input" t-att-data-project="project.project" t-att-data-day-count="day_count">

  <option>1</option>

  <option>0.5</option>

  <option>0</option>

                            </select>

Would anyone know how to attribute the t-att-data-project and t-att-day_count in the selection please.

Thanks a lot in advance.

Best regards.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Here I can give you an example where odoo uses the selection for Database Selector.

<t t-foreach="databases" t-as="db">
<option t-att-selected="'selected' if db == request.db else None">
<t t-esc="db"/>
</option>
</t>

Here Iterating through databases object and DB is the value of the option.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
3
ก.ย. 23
21055
1
มี.ค. 21
4889
2
ต.ค. 20
12972
0
พ.ค. 17
2468
0
พ.ค. 22
2178