📜  如何将新记录中的值返回到 odoo - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:22.696000             🧑  作者: Mango

代码示例1
def computeremainingFeeds(self):
        for rec in self:
            if rec.feed_received_kg != 0:
                rec.remaining_feed_credit = rec.feed_received_kg - rec.feed_consumed_kg
            elif rec.remaining_feed_credit != 0:
                rec.remaining_feed_credit = rec.remaining_feed_credit - rec.feed_consumed_kg
        return remaining_feed_credit