Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3560 มุมมอง
<t t-foreach="project.responsibles_ids" t-as="responsible">
	<span t-field="responsible" t-field-options='{"widget": "contact", "fields": ["name", "phone"]}' />
</t>

The above code gives an error:

AssertionError: t-field must have at least a dot like 'record.field_name'

How do i fix this ? It is not possible to use t-field inside an iteration ?

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

t-field can only be use to print the data of the respected fields. Use t-esc and t-options in your case.

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

Hi,

Odoo qweb's t-field directive can only be used when performing field access (Only work on stored fields) or formatting data. Also, t-field-options can be used to customize fields. See below example.

<t-field="record.date" t-field-options='{"widget":"date"'}'/>


Regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ค. 25
2552
1
พ.ค. 25
3092
QWeb: use t-if to check birthday date แก้ไขแล้ว
1
เม.ย. 25
2960
1
ก.พ. 25
2261
0
ต.ค. 24
1909