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

I tried two ways to display many2many field in list view but none of them worked:

1) <field name="test_ids"/> --> It shows just the number of records.(i.e. (3 records))

2) <field name="test_ids" widget="many2many"/> --> It shows the ids of records. (i.e. 2,3,4)

How to achive this?

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

use ==> widget="many2many_tags"

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

I already tried this but not working. It shows the ids of records. (i.e. 2,3,4)

Tác giả

Tnx. There was some issue in my db. I created new db and it worked.

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

Hello Rakesh,

.py - field_name = fields.Many2many('res.partner', string="many2many_tags")

.xml - <field name="field_name" widget="many2many_tags"/>


Hope it helps,

Regards,

Mayank Gosai

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

Tnx. There was some issue in my db. I created new db and it worked.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 20
13895
1
thg 10 16
3931
1
thg 9 15
10525
0
thg 12 23
1416
1
thg 5 23
2928