As you all know, Customer payments have 2 technical components : Account_voucher and Account_voucher_line.
On Customer Payments two fields interests me for the moment :
The amount field of account_voucher.
The amount field of account_voucher_line.
There is an onchange method on the field "amount" of account_voucher_line,
def onchange_amount(self, cr, uid, ids, amount, amount_unreconciled, context=None):
vals = {}
if amount:
vals['reconcile'] = (amount == amount_unreconciled)
return {'value': vals}
it checks true if the amount is reconcilied, I want to return on the same onchange method the sum of every amount payed, for every voucher line, on the field amount of account.voucher.
So it's an onchange method from account_voucher_line into account_voucher.
I've tested a code, but it reacts on the field "amount" of account_voucher_line and not account_voucher.
It seems that there is a limitation, because, the onchange method works only on fields of the same model I guess.
Any recommandations for this issue ?