计算python

时间:2018-04-13 10:13:22

标签: odoo

[@ 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]

enter image description here

剩余金额的第二项。应通过减少以前的剩余金额但减少到期金额来减少金额。

0 个答案:

没有答案