Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
2806 Weergaven

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
Annuleer
Beste antwoord

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

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
jan. 20
3812
0
mrt. 15
4250
0
mrt. 15
3910
1
jul. 25
372
1
feb. 25
1201