Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
2683 Zobrazení

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
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
led 20
3685
0
bře 15
4154
0
bře 15
3850
1
úno 25
1036
1
led 25
1420