Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
1781 Vues

Hello,

minimal example...

class School(models.Model):
related_student = fields.One2many('school.student', 'school_student_id')
related_book = fields.Many2many(related='related_student.related_book')


I can see all related students but only 1 book. I want to see all books of all students.


Thank you









Avatar
Ignorer
Meilleure réponse

self.related_student.mapped('books_field_in_student_model') // this returns all distinct books of this school.

Avatar
Ignorer
Publications associées Réponses Vues Activité
3
sept. 25
2663
0
août 25
224
1
août 25
2220
2
juil. 25
8098
2
juil. 25
4547