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

Hello, 


I have a call declared with a 


@api.one
@api.depends('field1', 'field2')
def _compute_availibility(self):

inside a class which is part of a one2many relation.  I want to calculate a sum from values typed in previous lines, tried with 


self_values = self.search([('domain')])


but  values are always zeros, I believe it's because I can get only values from current line, since its a new line, all values are zero.


How can I access values from previous lines?




Thank you

الصورة الرمزية
إهمال
أفضل إجابة

Make compute on the one2many field, not on lines and you will get the full lines and can add data accordingly.

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يناير 20
3705
0
مارس 15
4175
0
مارس 15
3866
1
يوليو 25
209
Search a message تم الحل
1
فبراير 25
1072