diff --git a/user_weather_map/README.rst b/user_weather_map/README.rst new file mode 100644 index 000000000..3793eb438 --- /dev/null +++ b/user_weather_map/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +User Weather Notification +========================= +This module designed to provide weather updates and notifications within the Odoo ERP system. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +======= +General Public License, version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer : (V17) Bhagyadev KP, +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_map/__init__.py b/user_weather_map/__init__.py new file mode 100755 index 000000000..1ee7644b0 --- /dev/null +++ b/user_weather_map/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +from . import controllers +from . import models diff --git a/user_weather_map/__manifest__.py b/user_weather_map/__manifest__.py new file mode 100644 index 000000000..9d4cce531 --- /dev/null +++ b/user_weather_map/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +{ + 'name': 'User Weather Notification', + 'version': '17.0.1.0.0', + 'category': 'Productivity', + 'summary': """The User Weather Notification Odoo app is an extension module + that integrates weather forecasting functionality into the Odoo ERP + system""", + 'description': """The User Weather Notification app enhances the usability + of the Odoo platform by integrating weather data and alerts. It enables + users to stay informed about weather conditions and receive timely + notifications based on their chosen locations'""", + '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'], + 'assets': { + 'web.assets_backend': [ + 'user_weather_map/static/src/js/WeatherMenu.js', + 'user_weather_map/static/src/xml/weather_notification_templates.xml', + ], + }, + 'external_dependencies': { + 'python': ['geocoder'], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/user_weather_map/controllers/__init__.py b/user_weather_map/controllers/__init__.py new file mode 100755 index 000000000..cab88fca8 --- /dev/null +++ b/user_weather_map/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +from . import user_weather_map diff --git a/user_weather_map/controllers/user_weather_map.py b/user_weather_map/controllers/user_weather_map.py new file mode 100644 index 000000000..a5cde5c93 --- /dev/null +++ b/user_weather_map/controllers/user_weather_map.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +import geocoder +import requests +from odoo import http +from odoo.http import request + + +class WeatherNotification(http.Controller): + """ + Controller class for fetching weather details based on location. + This class provides a controller to fetch weather information based on the + user's location setting. + It supports both automatic and manual location settings. + """ + + @http.route('/weather/notification/check', type='json', auth="public", + methods=['POST']) + def weather_notification(self): + """ + Controller for fetching weather data + :return: Dictionary of weather information + :rtype: dict + """ + weather_data = {'data': False} + if request.env.user.api_key: + if request.env.user.location_set == 'auto': + try: + response = geocoder.ip('me') + if response.status_code == 200: + lat = round(response.latlng[0], 2) + lng = round(response.latlng[1], 2) + url = 'https://api.openweathermap.org/data/2.5' \ + f'/weather?lat={lat}&lon={lng}&appid={request.env.user.api_key}' + weather = requests.get(url, timeout=20) + if weather.status_code == 200: + weather_data = weather.json() + except Exception: + pass + elif request.env.user.location_set == 'manual': + try: + url = 'https://api.openweathermap.org/data/2.5' \ + f'/weather?q={request.env.user.city}&appid={request.env.user.api_key}' + city_req = requests.get(url, timeout=20) + if city_req.status_code == 200: + weather_data = city_req.json() + except Exception: + pass + return weather_data diff --git a/user_weather_map/doc/RELEASE_NOTES.md b/user_weather_map/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..b76e44525 --- /dev/null +++ b/user_weather_map/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 09.01.2024 +#### Version 17.0.1.0.0 +#### ADD + +- Initial commit for User Weather Notification diff --git a/user_weather_map/models/__init__.py b/user_weather_map/models/__init__.py new file mode 100644 index 000000000..edb6568fc --- /dev/null +++ b/user_weather_map/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +from . import res_users diff --git a/user_weather_map/models/res_users.py b/user_weather_map/models/res_users.py new file mode 100644 index 000000000..7afd71cd5 --- /dev/null +++ b/user_weather_map/models/res_users.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +import requests +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError + + +class ResUsers(models.Model): + """ + Extends the 'res.users' model to include additional fields related to + weather information. + """ + _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="Setting and managing locations") + city = fields.Char(string='City', help="City of the user") + + @api.constrains('city') + def _check_city(self): + """Checking the city valid or not""" + 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}' + city_check = requests.get(url, timeout=20).json() + if city_check['cod'] != 200: + raise ValidationError(_(city_check['message'])) diff --git a/user_weather_map/static/description/assets/icons/capture (1).png b/user_weather_map/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/user_weather_map/static/description/assets/icons/capture (1).png differ diff --git a/user_weather_map/static/description/assets/icons/check.png b/user_weather_map/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/user_weather_map/static/description/assets/icons/check.png differ diff --git a/user_weather_map/static/description/assets/icons/chevron.png b/user_weather_map/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/chevron.png differ diff --git a/user_weather_map/static/description/assets/icons/cogs.png b/user_weather_map/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/cogs.png differ diff --git a/user_weather_map/static/description/assets/icons/consultation.png b/user_weather_map/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/user_weather_map/static/description/assets/icons/consultation.png differ diff --git a/user_weather_map/static/description/assets/icons/ecom-black.png b/user_weather_map/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/ecom-black.png differ diff --git a/user_weather_map/static/description/assets/icons/education-black.png b/user_weather_map/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/user_weather_map/static/description/assets/icons/education-black.png differ diff --git a/user_weather_map/static/description/assets/icons/hotel-black.png b/user_weather_map/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/user_weather_map/static/description/assets/icons/hotel-black.png differ diff --git a/user_weather_map/static/description/assets/icons/img.png b/user_weather_map/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/img.png differ diff --git a/user_weather_map/static/description/assets/icons/license.png b/user_weather_map/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/user_weather_map/static/description/assets/icons/license.png differ diff --git a/user_weather_map/static/description/assets/icons/lifebuoy.png b/user_weather_map/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/user_weather_map/static/description/assets/icons/lifebuoy.png differ diff --git a/user_weather_map/static/description/assets/icons/manufacturing-black.png b/user_weather_map/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/user_weather_map/static/description/assets/icons/manufacturing-black.png differ diff --git a/user_weather_map/static/description/assets/icons/photo-capture.png b/user_weather_map/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/photo-capture.png differ diff --git a/user_weather_map/static/description/assets/icons/pos-black.png b/user_weather_map/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/pos-black.png differ diff --git a/user_weather_map/static/description/assets/icons/puzzle.png b/user_weather_map/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/puzzle.png differ diff --git a/user_weather_map/static/description/assets/icons/restaurant-black.png b/user_weather_map/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/restaurant-black.png differ diff --git a/user_weather_map/static/description/assets/icons/service-black.png b/user_weather_map/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/user_weather_map/static/description/assets/icons/service-black.png differ diff --git a/user_weather_map/static/description/assets/icons/trading-black.png b/user_weather_map/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/trading-black.png differ diff --git a/user_weather_map/static/description/assets/icons/training.png b/user_weather_map/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/user_weather_map/static/description/assets/icons/training.png differ diff --git a/user_weather_map/static/description/assets/icons/update.png b/user_weather_map/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/user_weather_map/static/description/assets/icons/update.png differ diff --git a/user_weather_map/static/description/assets/icons/user.png b/user_weather_map/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/user_weather_map/static/description/assets/icons/user.png differ diff --git a/user_weather_map/static/description/assets/icons/wrench.png b/user_weather_map/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/user_weather_map/static/description/assets/icons/wrench.png differ diff --git a/user_weather_map/static/description/assets/misc/Cybrosys R.png b/user_weather_map/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/user_weather_map/static/description/assets/misc/Cybrosys R.png differ diff --git a/user_weather_map/static/description/assets/misc/email.svg b/user_weather_map/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/user_weather_map/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/misc/phone.svg b/user_weather_map/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/user_weather_map/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/user_weather_map/static/description/assets/misc/star (1) 2.svg b/user_weather_map/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/user_weather_map/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/user_weather_map/static/description/assets/misc/support (1) 1.svg b/user_weather_map/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/user_weather_map/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/user_weather_map/static/description/assets/misc/support-email.svg b/user_weather_map/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/user_weather_map/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/user_weather_map/static/description/assets/misc/tick-mark.svg b/user_weather_map/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/user_weather_map/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/misc/whatsapp 1.svg b/user_weather_map/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/user_weather_map/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/user_weather_map/static/description/assets/misc/whatsapp.svg b/user_weather_map/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/user_weather_map/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/modules/m1.png b/user_weather_map/static/description/assets/modules/m1.png new file mode 100644 index 000000000..acb4c76c6 Binary files /dev/null and b/user_weather_map/static/description/assets/modules/m1.png differ diff --git a/user_weather_map/static/description/assets/modules/m2.png b/user_weather_map/static/description/assets/modules/m2.png new file mode 100644 index 000000000..3ef91f771 Binary files /dev/null and b/user_weather_map/static/description/assets/modules/m2.png differ diff --git a/user_weather_map/static/description/assets/modules/m3.png b/user_weather_map/static/description/assets/modules/m3.png new file mode 100644 index 000000000..72febf6ae Binary files /dev/null and b/user_weather_map/static/description/assets/modules/m3.png differ diff --git a/user_weather_map/static/description/assets/modules/m4.png b/user_weather_map/static/description/assets/modules/m4.png new file mode 100644 index 000000000..f7d7f9241 Binary files /dev/null and b/user_weather_map/static/description/assets/modules/m4.png differ diff --git a/user_weather_map/static/description/assets/modules/m5.png b/user_weather_map/static/description/assets/modules/m5.png new file mode 100644 index 000000000..1d3324e88 Binary files /dev/null and b/user_weather_map/static/description/assets/modules/m5.png differ diff --git a/user_weather_map/static/description/assets/modules/m6.png b/user_weather_map/static/description/assets/modules/m6.png new file mode 100644 index 000000000..80938c15a Binary files /dev/null and b/user_weather_map/static/description/assets/modules/m6.png differ diff --git a/user_weather_map/static/description/assets/screenshots/hero.gif b/user_weather_map/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..694de9803 Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/hero.gif differ diff --git a/user_weather_map/static/description/assets/screenshots/s1.png b/user_weather_map/static/description/assets/screenshots/s1.png new file mode 100644 index 000000000..9439cbc04 Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/s1.png differ diff --git a/user_weather_map/static/description/assets/screenshots/s2.png b/user_weather_map/static/description/assets/screenshots/s2.png new file mode 100644 index 000000000..c702e9152 Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/s2.png differ diff --git a/user_weather_map/static/description/assets/screenshots/s3.png b/user_weather_map/static/description/assets/screenshots/s3.png new file mode 100644 index 000000000..b259781ff Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/s3.png differ diff --git a/user_weather_map/static/description/assets/screenshots/s4.png b/user_weather_map/static/description/assets/screenshots/s4.png new file mode 100644 index 000000000..8b90b33aa Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/s4.png differ diff --git a/user_weather_map/static/description/assets/screenshots/s5.png b/user_weather_map/static/description/assets/screenshots/s5.png new file mode 100644 index 000000000..371821b2f Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/s5.png differ diff --git a/user_weather_map/static/description/assets/screenshots/s6.png b/user_weather_map/static/description/assets/screenshots/s6.png new file mode 100644 index 000000000..86012f909 Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/s6.png differ diff --git a/user_weather_map/static/description/assets/screenshots/s7.png b/user_weather_map/static/description/assets/screenshots/s7.png new file mode 100644 index 000000000..ff16610eb Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/s7.png differ diff --git a/user_weather_map/static/description/banner.jpg b/user_weather_map/static/description/banner.jpg new file mode 100644 index 000000000..d57102c09 Binary files /dev/null and b/user_weather_map/static/description/banner.jpg differ diff --git a/user_weather_map/static/description/icon.png b/user_weather_map/static/description/icon.png new file mode 100644 index 000000000..a568f7da1 Binary files /dev/null and b/user_weather_map/static/description/icon.png differ diff --git a/user_weather_map/static/description/index.html b/user_weather_map/static/description/index.html new file mode 100644 index 000000000..74a98a6f6 --- /dev/null +++ b/user_weather_map/static/description/index.html @@ -0,0 +1,603 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+
+
+
+
+

User Weather Notification

+

+ A Module For User Weather Notification. +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

The user will get the weather notification.

+
+
+
+
+
+
+ +
+
+

The user can configure their weather notification.

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

User can easily find the weather report from a single click.

+
+
+
+
+
+
+ +
+
+

Configuration: Go to Users in settings, then provide API Key of openweathermap and select auto location or manual location. +

+
+
+
+
+
+
+ + +
+
+

For manual location user must enter a valid city of openweathermap api. +

+
+
+
+
+
+
+ +
+
+

In order to access the Openweathermap API, it is mandatory to have an active account with them. You will need to create an account with Openweathermap in order to generate the API Key. +

+
+
+
+
+
+
+ +
+
+

Once you have created the account, access your API keys, start by clicking on your account and then selecting "My API Keys". +

+
+
+
+
+
+
+ +
+
+

Once you navigate to the "My API Keys" page, you can easily retrieve your API Key and use it as necessary.

+
+
+
+
+
+
+
    +
  • + The user will get the weather notification. +
  • +
  • + The user can configure their weather notification. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:5th January 2024 +
+

+ + Initial Commit for User Weather Notification.

+
+
+
+
+
+
+
+

Related Products

+
+
+ +
+
+

Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/user_weather_map/static/src/img/weather_card.jpg b/user_weather_map/static/src/img/weather_card.jpg new file mode 100644 index 000000000..cc5cda90c Binary files /dev/null and b/user_weather_map/static/src/img/weather_card.jpg differ diff --git a/user_weather_map/static/src/js/WeatherMenu.js b/user_weather_map/static/src/js/WeatherMenu.js new file mode 100644 index 000000000..6875fff7f --- /dev/null +++ b/user_weather_map/static/src/js/WeatherMenu.js @@ -0,0 +1,56 @@ +/** @odoo-module **/ + +import { CheckBox } from "@web/core/checkbox/checkbox"; +import { Dropdown } from "@web/core/dropdown/dropdown"; +import { DropdownItem } from "@web/core/dropdown/dropdown_item"; +import { Component } from '@odoo/owl'; +import { registry } from '@web/core/registry'; +import { useService } from "@web/core/utils/hooks"; +import { session } from "@web/session"; +import { browser } from "@web/core/browser/browser"; + + /** + * Menu item appended in the systray part of the navbar + */ +export class WeatherMenu extends Component{ + setup() { + this.user = useService("user"); + this.session = session; + this.rpc = useService("rpc"); + this.fetch_data() + } + async getElements() { + /**Updating weather data while loading template**/ + const self = this; + const weather_data = this.data; + if (weather_data.hasOwnProperty("data")) { + self.session.name = ''; + self.session.main = ''; + self.session.description = 'Provide a valid API key.'; + self.session.temp = ''; + } else { + self.session.name = weather_data.name; + self.session.main = weather_data.weather[0].main; + self.session.description = weather_data.weather[0].description; + self.session.temp = Math.round(weather_data.main['temp'] - 273.15); + } + } + fetch_data() { + /**Fetching weather data using rpc call**/ + var self = this; + this.rpc('/weather/notification/check', {}).then((data) => { + this.data = data + }); + } +}; + +WeatherMenu.template = 'systrayWeatherMenu'; +export const WeatherSystrayItem = { + Component: WeatherMenu, +}; +WeatherMenu.components = { + Dropdown, + DropdownItem, + CheckBox +}; +registry.category("systray").add("WeatherNotification", WeatherSystrayItem); diff --git a/user_weather_map/static/src/xml/weather_notification_templates.xml b/user_weather_map/static/src/xml/weather_notification_templates.xml new file mode 100644 index 000000000..5e4beaee0 --- /dev/null +++ b/user_weather_map/static/src/xml/weather_notification_templates.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + +
+ +
+ Card image cap +
+

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

+ 0C

+ +
+
+
+
+
+
+
+
+
+
diff --git a/user_weather_map/views/res_users_views.xml b/user_weather_map/views/res_users_views.xml new file mode 100644 index 000000000..b7bd7718b --- /dev/null +++ b/user_weather_map/views/res_users_views.xml @@ -0,0 +1,26 @@ + + + + + res.users.view.form.inherit.user.weather.map + res.users + form + + + + + + + + + + + + + +