Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
3283 Zobrazení
<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
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
čvc 25
1977
1
kvě 25
2100
1
dub 25
2491
1
úno 25
1772
0
říj 24
1513