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

Hello,

I have created 2 Modules; Album and Songs, the Songs has Many2One that connected to Album, so I can specify an album for each song.

Now my question is, How to show songs list from "Songs" module in "Album" module?

I can create Many2Many and link it so songs and select the songs manually, which is not what I'm looking for.

I want them to be shown automatically.

WHERE module_songs.album = module_album.album_name


My odoo is: Odoo Enterprise 15 with Studio

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

Hi  Sam,

Instead of Many2many create a One2many field in Album,

song_list = fields.One2many('song.song', 'album_id', 'Song List')

- album_id is the Many2one you created in Songs

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

This is exactly what I need, it works perfectly!

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 22
2264
1
thg 12 24
3131
2
thg 6 24
14889
0
thg 2 24
2176
1
thg 12 23
2518