diff --git a/user_weather_notification/README.rst b/user_weather_notification/README.rst new file mode 100644 index 000000000..b615364a7 --- /dev/null +++ b/user_weather_notification/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +User Weather Notification +========================= +A weather notification app providing users with timely weather updates and alerts. + +Configuration +============= +- Required OpenWeatherMap API. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V14) Mohamed Muzammil VP, Contact : odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/user_weather_notification/__init__.py b/user_weather_notification/__init__.py new file mode 100755 index 000000000..26f86433e --- /dev/null +++ b/user_weather_notification/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import controllers +from . import models diff --git a/user_weather_notification/__manifest__.py b/user_weather_notification/__manifest__.py new file mode 100755 index 000000000..1245e03f4 --- /dev/null +++ b/user_weather_notification/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +{ + 'name': 'User Weather Notification', + 'version': '14.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """A weather notification app providing users with timely + weather updates and alerts.""", + 'description': """Users can see Weather Notification by using + OpenWeatherMap API""", + 'author': "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['web'], + 'data': [ + 'views/res_users_views.xml', + 'views/assets.xml', + ], + 'qweb': [ + 'static/src/xml/weather_notification_templates.xml', + ], + 'external_dependencies': { + 'python': ['geocoder'], + }, + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/user_weather_notification/controllers/__init__.py b/user_weather_notification/controllers/__init__.py new file mode 100755 index 000000000..f2d304621 --- /dev/null +++ b/user_weather_notification/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import user_weather_notification diff --git a/user_weather_notification/controllers/user_weather_notification.py b/user_weather_notification/controllers/user_weather_notification.py new file mode 100644 index 000000000..937215b1a --- /dev/null +++ b/user_weather_notification/controllers/user_weather_notification.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +import geocoder +import requests +from requests.exceptions import ConnectionError, Timeout +from odoo import http +from odoo.http import request + + +class WeatherNotification(http.Controller): + """Class defined to fetch weather details based on location""" + + @http.route('/weather/notification/check', type='json', auth="public", + methods=['POST']) + def weather_notification(self): + """Controller for fetching weather data""" + try: + if request.env.user.location_set == 'auto' \ + and request.env.user.api_key: + if geocoder.ip('me').status_code == 200: + lat = round(geocoder.ip('me').latlng[0], 2) + lng = round(geocoder.ip('me').latlng[1], 2) + url = f'https://api.openweathermap.org/data/2.5/weather?lat={lat}&lon={lng}&appid={request.env.user.api_key}' + try: + # Set timeout to 5 seconds + response = requests.get(url, timeout=5) + if response.status_code == 200: + return response.json() + else: + return {'data': False} + except Timeout: + return {'data': False, 'message': 'Request timed out.'} + else: + return {'data': False, + 'message': 'Failed to get location data.'} + elif request.env.user.location_set == 'manual' \ + and request.env.user.api_key: + url = f'https://api.openweathermap.org/data/2.5/weather?q={request.env.user.city}&appid={request.env.user.api_key}' + try: + # Set timeout to 5 seconds + response = requests.get(url, timeout=5) + if response.status_code == 200: + return response.json() + else: + return {'data': False} + except Timeout: + return {'data': False, 'message': 'Request timed out.'} + except ConnectionError: + return {'data': False, + 'message': 'No internet connection. ' + 'Please check your internet connectivity.'} + else: + return {'data': False} diff --git a/user_weather_notification/doc/RELEASE_NOTES.md b/user_weather_notification/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..e2b820a4d --- /dev/null +++ b/user_weather_notification/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 11.08.2023 +#### Version 14.0.1.0.0 +#### ADD +- Initial commit for User Weather Notification diff --git a/user_weather_notification/models/__init__.py b/user_weather_notification/models/__init__.py new file mode 100644 index 000000000..8da09c18c --- /dev/null +++ b/user_weather_notification/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +from . import res_users diff --git a/user_weather_notification/models/res_users.py b/user_weather_notification/models/res_users.py new file mode 100644 index 000000000..6ecbed69c --- /dev/null +++ b/user_weather_notification/models/res_users.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Mohamed Muzammil VP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +################################################################################ +import requests +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError + + +class ResUsers(models.Model): + """Inherit the res.users model to add custom fields and methods""" + _inherit = "res.users" + + api_key = fields.Char(string='API Key', help="API key from OpenWeatherMap") + location_set = fields.Selection( + selection=[('auto', 'Use Browser Location'), + ('manual', 'Manual Location')], + string="Set Location", default='auto', + help="Use Browser Location: Fetching data based on browsers location," + "Manual Location:Need to specify the city in the city field") + city = fields.Char(string='City', + help="Enter the city name to find weather") + + @api.constrains('city') + def _check_city(self): + """Constraints to check if the city is valid or not""" + try: + for rec in self: + if rec.api_key: + url = f'https://api.openweathermap.org/data/2.5/weather?q={rec.city}&appid={rec.api_key}' + try: + # Set timeout to 5 seconds + response = requests.get(url, timeout=5) + response_json = response.json() + if response_json['cod'] != 200: + raise ValidationError(_(response_json['message'])) + except requests.Timeout: + raise ValidationError( + _('API request timed out. Please check your ' + 'internet connection or try again later.')) + except requests.exceptions.ConnectionError: + raise ValidationError( + _('Please check your internet connection or try again later.')) + + @api.constrains('city', 'location_set') + def validation_of_city(self): + """The city name should be required if the location is set to + manual.""" + if self.location_set == 'manual' and self.city is False: + raise ValidationError(_('Please Enter a city name')) diff --git a/user_weather_notification/static/description/assets/icons/cogs.png b/user_weather_notification/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/cogs.png differ diff --git a/user_weather_notification/static/description/assets/icons/consultation.png b/user_weather_notification/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/consultation.png differ diff --git a/user_weather_notification/static/description/assets/icons/ecom-black.png b/user_weather_notification/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/ecom-black.png differ diff --git a/user_weather_notification/static/description/assets/icons/education-black.png b/user_weather_notification/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/education-black.png differ diff --git a/user_weather_notification/static/description/assets/icons/hotel-black.png b/user_weather_notification/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/hotel-black.png differ diff --git a/user_weather_notification/static/description/assets/icons/insta_feed_snippet_icon.png b/user_weather_notification/static/description/assets/icons/insta_feed_snippet_icon.png new file mode 100644 index 000000000..9af668a31 Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/insta_feed_snippet_icon.png differ diff --git a/user_weather_notification/static/description/assets/icons/license.png b/user_weather_notification/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/license.png differ diff --git a/user_weather_notification/static/description/assets/icons/lifebuoy.png b/user_weather_notification/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/lifebuoy.png differ diff --git a/user_weather_notification/static/description/assets/icons/logo.png b/user_weather_notification/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/logo.png differ diff --git a/user_weather_notification/static/description/assets/icons/manufacturing-black.png b/user_weather_notification/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/manufacturing-black.png differ diff --git a/user_weather_notification/static/description/assets/icons/pos-black.png b/user_weather_notification/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/pos-black.png differ diff --git a/user_weather_notification/static/description/assets/icons/puzzle.png b/user_weather_notification/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/puzzle.png differ diff --git a/user_weather_notification/static/description/assets/icons/restaurant-black.png b/user_weather_notification/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/restaurant-black.png differ diff --git a/user_weather_notification/static/description/assets/icons/service-black.png b/user_weather_notification/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/service-black.png differ diff --git a/user_weather_notification/static/description/assets/icons/trading-black.png b/user_weather_notification/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/trading-black.png differ diff --git a/user_weather_notification/static/description/assets/icons/training.png b/user_weather_notification/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/training.png differ diff --git a/user_weather_notification/static/description/assets/icons/update.png b/user_weather_notification/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/update.png differ diff --git a/user_weather_notification/static/description/assets/icons/user.png b/user_weather_notification/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/user.png differ diff --git a/user_weather_notification/static/description/assets/icons/wrench.png b/user_weather_notification/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/user_weather_notification/static/description/assets/icons/wrench.png differ diff --git a/user_weather_notification/static/description/assets/misc/categories.png b/user_weather_notification/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/categories.png differ diff --git a/user_weather_notification/static/description/assets/misc/check-box.png b/user_weather_notification/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/check-box.png differ diff --git a/user_weather_notification/static/description/assets/misc/compass.png b/user_weather_notification/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/compass.png differ diff --git a/user_weather_notification/static/description/assets/misc/corporate.png b/user_weather_notification/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/corporate.png differ diff --git a/user_weather_notification/static/description/assets/misc/customer-support.png b/user_weather_notification/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/customer-support.png differ diff --git a/user_weather_notification/static/description/assets/misc/cybrosys-logo.png b/user_weather_notification/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/cybrosys-logo.png differ diff --git a/user_weather_notification/static/description/assets/misc/features.png b/user_weather_notification/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/features.png differ diff --git a/user_weather_notification/static/description/assets/misc/logo.png b/user_weather_notification/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/logo.png differ diff --git a/user_weather_notification/static/description/assets/misc/pictures.png b/user_weather_notification/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/pictures.png differ diff --git a/user_weather_notification/static/description/assets/misc/pie-chart.png b/user_weather_notification/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/pie-chart.png differ diff --git a/user_weather_notification/static/description/assets/misc/right-arrow.png b/user_weather_notification/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/right-arrow.png differ diff --git a/user_weather_notification/static/description/assets/misc/star.png b/user_weather_notification/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/star.png differ diff --git a/user_weather_notification/static/description/assets/misc/support.png b/user_weather_notification/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/support.png differ diff --git a/user_weather_notification/static/description/assets/misc/whatsapp.png b/user_weather_notification/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/user_weather_notification/static/description/assets/misc/whatsapp.png differ diff --git a/user_weather_notification/static/description/assets/modules/1.png b/user_weather_notification/static/description/assets/modules/1.png new file mode 100644 index 000000000..6d11dfe59 Binary files /dev/null and b/user_weather_notification/static/description/assets/modules/1.png differ diff --git a/user_weather_notification/static/description/assets/modules/2.png b/user_weather_notification/static/description/assets/modules/2.png new file mode 100644 index 000000000..4e4ea0e51 Binary files /dev/null and b/user_weather_notification/static/description/assets/modules/2.png differ diff --git a/user_weather_notification/static/description/assets/modules/3.png b/user_weather_notification/static/description/assets/modules/3.png new file mode 100644 index 000000000..844b870eb Binary files /dev/null and b/user_weather_notification/static/description/assets/modules/3.png differ diff --git a/user_weather_notification/static/description/assets/modules/4.png b/user_weather_notification/static/description/assets/modules/4.png new file mode 100644 index 000000000..0f0d5d3c2 Binary files /dev/null and b/user_weather_notification/static/description/assets/modules/4.png differ diff --git a/user_weather_notification/static/description/assets/modules/5.png b/user_weather_notification/static/description/assets/modules/5.png new file mode 100644 index 000000000..713d6dee5 Binary files /dev/null and b/user_weather_notification/static/description/assets/modules/5.png differ diff --git a/user_weather_notification/static/description/assets/modules/6.gif b/user_weather_notification/static/description/assets/modules/6.gif new file mode 100644 index 000000000..474c6e6b9 Binary files /dev/null and b/user_weather_notification/static/description/assets/modules/6.gif differ diff --git a/user_weather_notification/static/description/assets/screenshots/1.png b/user_weather_notification/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..0c4862009 Binary files /dev/null and b/user_weather_notification/static/description/assets/screenshots/1.png differ diff --git a/user_weather_notification/static/description/assets/screenshots/2.png b/user_weather_notification/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..5c8463615 Binary files /dev/null and b/user_weather_notification/static/description/assets/screenshots/2.png differ diff --git a/user_weather_notification/static/description/assets/screenshots/3.png b/user_weather_notification/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..7d5691a59 Binary files /dev/null and b/user_weather_notification/static/description/assets/screenshots/3.png differ diff --git a/user_weather_notification/static/description/assets/screenshots/4.png b/user_weather_notification/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..50d055f5c Binary files /dev/null and b/user_weather_notification/static/description/assets/screenshots/4.png differ diff --git a/user_weather_notification/static/description/assets/screenshots/5.png b/user_weather_notification/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..e2fb9a15a Binary files /dev/null and b/user_weather_notification/static/description/assets/screenshots/5.png differ diff --git a/user_weather_notification/static/description/assets/screenshots/6.png b/user_weather_notification/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..87911db7b Binary files /dev/null and b/user_weather_notification/static/description/assets/screenshots/6.png differ diff --git a/user_weather_notification/static/description/assets/screenshots/7.png b/user_weather_notification/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..50d885e4a Binary files /dev/null and b/user_weather_notification/static/description/assets/screenshots/7.png differ diff --git a/user_weather_notification/static/description/assets/screenshots/hero.gif b/user_weather_notification/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..223ca578b Binary files /dev/null and b/user_weather_notification/static/description/assets/screenshots/hero.gif differ diff --git a/user_weather_notification/static/description/banner.png b/user_weather_notification/static/description/banner.png new file mode 100644 index 000000000..59320cb2d Binary files /dev/null and b/user_weather_notification/static/description/banner.png differ diff --git a/user_weather_notification/static/description/icon.png b/user_weather_notification/static/description/icon.png new file mode 100644 index 000000000..8d05938d5 Binary files /dev/null and b/user_weather_notification/static/description/icon.png differ diff --git a/user_weather_notification/static/description/index.html b/user_weather_notification/static/description/index.html new file mode 100644 index 000000000..4d124294b --- /dev/null +++ b/user_weather_notification/static/description/index.html @@ -0,0 +1,550 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ User Weather Notification

+

A Weather Notification App Providing Users with Timely Weather Updates and Alerts.

+ + +
+
+
+
+ + +
+
+ +
+

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ As we know, many industries are depend on weather conditions like manufacturing, Event Management, + Construction etc. So we believe our concept of weather module can be used in these industries to + understand and plan their works according to the weather condition. This module is a starter to think + and explore the opportunity to bring the advanced features in Odoo. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + Support in Desktop. +
+
+
+
+ + The user will get the weather notification +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+
+

Click Weather Settings +

+

+ User can easily find the weather report from a single click. Summary of the weather conditions is + displayed on the weather board. The user will easily get weather updates, state of climate and current + temperature etc.

+ +
+
+

Configuration +

+

+ User must provide an API Key for OpenWeatherMap and select "Use Browser Location" or "Manual Location" from Set Location field. +

+ +
+
+

See the Weather details. +

+

After Filling the fields given user can see the weather details by clicking the Weather icon. +

+ +
+
+ +
+
+

If the entered city name is wrong. +

+

After choosing the Set Location field as "Manual Location" and entered city name was wrong then error pop-up shows. +

+ +
+
+

If the Network Connection is lost. +

+

+

+ +
+
+

Required OpenWeatherMap API. +

+ +
+
+
+ + + +
+
+ +
+

Suggested + Products +

+
+
+
+ +
+
+ + + +
+
+ +
+

Our Services +

+
+
+
+
+
+ +
+
+ Odoo + Customization
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Support
+
+
+
+ +
+
+ Hire + Odoo + Developer
+
+
+
+ +
+
+ Odoo + Integration
+
+
+
+ +
+
+ Odoo + Migration
+
+
+
+ +
+
+ Odoo + Consultancy
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + + +
+
+ +
+

Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + +
+
+ +
+

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/user_weather_notification/static/src/img/weather_card.jpg b/user_weather_notification/static/src/img/weather_card.jpg new file mode 100644 index 000000000..cc5cda90c Binary files /dev/null and b/user_weather_notification/static/src/img/weather_card.jpg differ diff --git a/user_weather_notification/static/src/js/weather_notification.js b/user_weather_notification/static/src/js/weather_notification.js new file mode 100644 index 000000000..46ba10a47 --- /dev/null +++ b/user_weather_notification/static/src/js/weather_notification.js @@ -0,0 +1,49 @@ +odoo.define('user_weather_notification.weather_card', function (require) { + "use strict"; + var SystrayMenu = require('web.SystrayMenu'); + var Widget = require('web.Widget'); + var rpc = require('web.rpc'); + /** + * Extends Widget and adds the template for the weather card. + */ + var ActionMenu = Widget.extend({ + template: 'user_weather_notification.UserMenuS', + events: { + 'click #get-weather': 'OnClickGetWeather', + }, + /** + * Hides the card when the widget starts. + */ + start: function () { + var self = this; + self.$('.card').hide(); + }, + /** + * Toggles the visibility of the weather card. + */ + OnClickGetWeather: async function () { + var self = this; + if (self.$(".card").is(":visible")) { + self.$('.card').hide(); + } else { + self.$('.card').show(); + // Take the data from the controller and show it + rpc.query({ + route: "/weather/notification/check", + }).then(function (result) { + if (result.data == false) { + self.$("#description").text('Configure Settings'); + } else { + self.$("#title").text(result.name); + self.$("#text").text(result.weather[0].main); + var temp = Math.floor(result.main.temp - 273); + self.$("#temperature").text(temp + "°C"); + self.$("#description").text(result.weather[0].description); + } + }); + } + } + }); + SystrayMenu.Items.push(ActionMenu); + return ActionMenu; +}); diff --git a/user_weather_notification/static/src/scss/weather.scss b/user_weather_notification/static/src/scss/weather.scss new file mode 100644 index 000000000..405a142f6 --- /dev/null +++ b/user_weather_notification/static/src/scss/weather.scss @@ -0,0 +1,11 @@ +.card { + display:block; + position:absolute; + top: 40px; + width: 250px; + right:-100px; + height: 210px; +} +.img{ + width: 248px; +} diff --git a/user_weather_notification/static/src/xml/weather_notification_templates.xml b/user_weather_notification/static/src/xml/weather_notification_templates.xml new file mode 100644 index 000000000..e2a4c61b8 --- /dev/null +++ b/user_weather_notification/static/src/xml/weather_notification_templates.xml @@ -0,0 +1,52 @@ + + + + +
+ +
+
+ + +
  • + +
  • +
    +
    diff --git a/user_weather_notification/views/assets.xml b/user_weather_notification/views/assets.xml new file mode 100644 index 000000000..dcb7ffffc --- /dev/null +++ b/user_weather_notification/views/assets.xml @@ -0,0 +1,13 @@ + + + +