跳至內容
選單
此問題已被標幟
2 回覆
6225 瀏覽次數

I have a many2many field in xml. Now I want to display the same in report but it shows ID instead of addressee name like addresses(9,19) where as I want show it as Addressee Name. I have add the model field too but not working.
 
Please any leads if any
Thanks  

頭像
捨棄
作者

Hi, Sudhir and Kiran
Thank you for valued suggestions
I tried < span t-field="o.my_m2m_field"/> as suggested by Sudhir and it worked for me

作者

Hi, Sudhir and Kiran
Thank you for valued suggestions
I tried < span t-field="o.my_m2m_field"/> as suggested by both of you and it worked for me

最佳答案

It would have been better if you would have shared your code.

Try the following code:

< span t-field="o.my_m2m_field"/>


Try the following if the above code doesn't work:

< t t-foreach="doc.m2m_field" t-as="line">
     < span t-esc="line.name"/>
< /t>


頭像
捨棄
最佳答案

Hi Hafiz,

You can achieve this by adding a for loop,

eg:

<t t-foreach="o.picking_ids" t-as="pick">
<span t-field="pick.name"/>
</t>

Hope it helps,

Kiran K

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
4月 25
1236
2
3月 25
1407
4
11月 24
7100
1
3月 24
2034
3
9月 23
24838