Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3255 Lượt xem
<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 ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 25
1959
1
thg 5 25
2047
1
thg 4 25
2478
1
thg 2 25
1749
0
thg 10 24
1493