Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
3201 Weergaven
<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
Annuleer
Beste antwoord

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

Avatar
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jul. 25
1782
1
mei 25
1866
1
apr. 25
2338
1
feb. 25
1619
0
okt. 24
1412