Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2947 มุมมอง

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ม.ค. 20
3911
0
มี.ค. 15
4308
0
มี.ค. 15
3987
1
ก.ค. 25
515
Search a message แก้ไขแล้ว
1
ก.พ. 25
1247