Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
3237 Vues
<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
Ignorer
Meilleure réponse

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

Avatar
Ignorer
Meilleure réponse

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
Ignorer
Publications associées Réponses Vues Activité
1
juil. 25
1869
1
mai 25
1949
1
avr. 25
2383
1
févr. 25
1677
0
oct. 24
1447