So geben Sie den Wert in neuem Datensatz an ODOO zurück
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
Moode