Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
3244 Visualizzazioni
<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
Abbandona
Risposta migliore

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

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
lug 25
1893
1
mag 25
1990
1
apr 25
2403
1
feb 25
1693
0
ott 24
1457