Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
3163 Tampilan
<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 ?

Avatar
Buang
Jawaban Terbai

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

Avatar
Buang
Jawaban Terbai

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

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jul 25
1705
1
Mei 25
1698
1
Apr 25
2276
1
Feb 25
1563
0
Okt 24
1319