تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2612 أدوات العرض

Suppose you have the following:

class A

_name='A.class'

a=fields.One2many('B.class', 'line_id, 'B_lines')


class B

_name='B.class'

b=fields.Many2one('A.class', 'line')

name=fields.Char('name')


Now, I want to add in class A a field named  c, which will display all the records of B class that belong to the a field of A class.

E.g. if I have 2 records of field "a" and each record has 3 "B" records, I want c field to display all 6 B records in a list.

I tried with a related field but could only get the B records of the first record of a field. 

I also tried with a compute method but didn't succeed.


Any idea how I could achieve this?



الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
يناير 20
5314
1
مايو 24
2618
2
مايو 20
6033
1
مارس 15
6076
3
سبتمبر 21
7159