跳至內容
選單
此問題已被標幟
1 回覆
2855 瀏覽次數

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

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
1月 20
3840
0
3月 15
4258
0
3月 15
3918
1
7月 25
398
1
2月 25
1213