跳至內容
選單
此問題已被標幟
2 回覆
3243 瀏覽次數
<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 ?

頭像
捨棄
最佳答案

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

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
7月 25
1876
1
5月 25
1962
1
4月 25
2394
1
2月 25
1682
0
10月 24
1455