跳至內容
選單
此問題已被標幟
3336 瀏覽次數

I declared a  computed field:

'member_still_pay': fields.float(compute='_get_total', type='float', string='Still to pay')
@api.multi
def _get_total(self):
temp = 0.0
for rec in self:
temp = sum(line.payment_amount for line in rec.member_payments)
rec.member_still_pay = rec.member_cotisation - temp

The problem is I don't have the good value in member_still_pay. The field payment_amount is a one2many. Somebody know what is false?

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
9月 24
1391
0
12月 23
1336
0
10月 21
2929
1
7月 21
3697
2
12月 19
5197