Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2818 Tampilan

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
Buang
Jawaban Terbai

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

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Jan 20
3820
0
Mar 15
4253
0
Mar 15
3913
1
Jul 25
383
Search a message Diselesaikan
1
Feb 25
1203