📅  最后修改于: 2022-03-11 14:45:22.696000             🧑  作者: Mango
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