İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
3223 Görünümler

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

Avatar
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Oca 20
4120
0
Mar 15
4499
0
Mar 15
4229
1
Tem 25
920
Search a message Çözüldü
1
Şub 25
1499