Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2543 มุมมอง

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

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

This is exactly what I need, it works perfectly!

Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
Documents for products / Studio แก้ไขแล้ว
1
มี.ค. 22
2255
Restrict Studio ,to users แก้ไขแล้ว
1
ธ.ค. 24
3109
2
มิ.ย. 24
14865
0
ก.พ. 24
2156
1
ธ.ค. 23
2483