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

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?

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
zář 24
1374
0
pro 23
1313
0
říj 21
2914
1
čvc 21
3679
2
pro 19
5189