I want to access the seats_number field from the plane model when the name field in the plane model is equal to the plane_id firld from the flight model
@api.depends(‘plane_id’)
def _compute_seats_number(self):
for flight in self:
for plane in self.env[‘airport.plane’].search([]):
if flight.plane_id == plane.name:
flight.seats_number = plane.seats_number
break