I have a function which checks the dates and then calculates the arrivals and departures using the data. but there are two problems, the first one is that I need to do this an automatic function so the user doesn't need to click 'update' and I tried to solve this by using this code below:
@api.model
def fields_view_get(self, view_id=None, view_type='form', toolbar=False,
submenu=False):
res = super(HotelReservation, self).fields_view_get(
view_id=view_id, view_type=view_type, toolbar=toolbar,
submenu=submenu)
self.expected_arrivals_departures()
return res
the only problem with this is that it runs 5 times when I need only 1 time to run my function.
Can someone please help me?