diff --git a/weather_infor/data/weather_infor_cron.xml b/weather_infor/data/weather_infor_cron.xml index 629b2c3..6977748 100644 --- a/weather_infor/data/weather_infor_cron.xml +++ b/weather_infor/data/weather_infor_cron.xml @@ -1,6 +1,5 @@ - Fetch Weather Data @@ -8,7 +7,8 @@ minutes code - model.search([]).fetch_weather() + + model.search([]).fetch_weather() + - diff --git a/weather_infor/models/weather_information.py b/weather_infor/models/weather_information.py index 27bb02c..971dab3 100644 --- a/weather_infor/models/weather_information.py +++ b/weather_infor/models/weather_information.py @@ -34,5 +34,6 @@ class WeatherInformation(models.Model): def fetch_weather(self): """Fetch weather data and update the record""" - weather_data = self.get_weather_information(self.city) - self.write(weather_data) \ No newline at end of file + for record in self: + weather_data = self.get_weather_information(record.city) + record.write(weather_data) \ No newline at end of file