Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
2994 Visualizzazioni

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
Abbandona
Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
gen 20
3989
0
mar 15
4340
0
mar 15
4022
1
lug 25
596
1
feb 25
1301