Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6193 Lượt xem

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  

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Tác giả

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

Câu trả lời hay nhất

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>


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhấ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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 25
1215
2
thg 3 25
1359
4
thg 11 24
7082
1
thg 3 24
1998
3
thg 9 23
24813