[@ api.depends('rel_id')
def payment_amount(self):
for rec in self:
if (rec.rel_id.amount < rec.amount_paid):
raise ValidationError('Please enter correct amount')
elif (rec.rel_id.amount > rec.amount_paid):
rec.remaining_amount = rec.rel_id.amount - rec.amount_paid]
剩余金额的第二项。应通过减少以前的剩余金额但减少到期金额来减少金额。