Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
3197 Widoki
<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 ?

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
lip 25
1776
1
maj 25
1860
1
kwi 25
2333
1
lut 25
1615
0
paź 24
1410