diff --git a/user_weather_map/README.rst b/user_weather_map/README.rst new file mode 100644 index 000000000..05ecd4b2c --- /dev/null +++ b/user_weather_map/README.rst @@ -0,0 +1,49 @@ +.. 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 : (V18) Mufeeda Shirin, Nivedhya T + (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..332003602 --- /dev/null +++ b/user_weather_map/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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..d05a1f967 --- /dev/null +++ b/user_weather_map/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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': '18.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..1b0a3683e --- /dev/null +++ b/user_weather_map/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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..827a0043b --- /dev/null +++ b/user_weather_map/controllers/user_weather_map.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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..fbac1b3d6 --- /dev/null +++ b/user_weather_map/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 15.07.2025 +#### Version 18.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..c3098489d --- /dev/null +++ b/user_weather_map/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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..172596980 --- /dev/null +++ b/user_weather_map/models/res_users.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (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/cybro-icon.png b/user_weather_map/static/description/assets/cybro-icon.png new file mode 100644 index 000000000..06e73e11d Binary files /dev/null and b/user_weather_map/static/description/assets/cybro-icon.png differ diff --git a/user_weather_map/static/description/assets/cybro-odoo.png b/user_weather_map/static/description/assets/cybro-odoo.png new file mode 100644 index 000000000..ed02e07a4 Binary files /dev/null and b/user_weather_map/static/description/assets/cybro-odoo.png differ diff --git a/user_weather_map/static/description/assets/icons/arrows-repeat.svg b/user_weather_map/static/description/assets/icons/arrows-repeat.svg new file mode 100644 index 000000000..1d7efabc5 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/banner-1.png b/user_weather_map/static/description/assets/icons/banner-1.png new file mode 100644 index 000000000..c180db172 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/banner-1.png differ diff --git a/user_weather_map/static/description/assets/icons/banner-2.svg b/user_weather_map/static/description/assets/icons/banner-2.svg new file mode 100644 index 000000000..e606d97d9 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/banner-bg.png b/user_weather_map/static/description/assets/icons/banner-bg.png new file mode 100644 index 000000000..a8238d3c0 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/banner-bg.png differ diff --git a/user_weather_map/static/description/assets/icons/banner-bg.svg b/user_weather_map/static/description/assets/icons/banner-bg.svg new file mode 100644 index 000000000..b1378103e --- /dev/null +++ b/user_weather_map/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/banner-call.svg b/user_weather_map/static/description/assets/icons/banner-call.svg new file mode 100644 index 000000000..96c687e81 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/user_weather_map/static/description/assets/icons/banner-mail.svg b/user_weather_map/static/description/assets/icons/banner-mail.svg new file mode 100644 index 000000000..cbf0d158d --- /dev/null +++ b/user_weather_map/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/user_weather_map/static/description/assets/icons/banner-pattern.svg b/user_weather_map/static/description/assets/icons/banner-pattern.svg new file mode 100644 index 000000000..9c1c7e101 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/banner-promo.svg b/user_weather_map/static/description/assets/icons/banner-promo.svg new file mode 100644 index 000000000..d52791b11 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/brand-pair.svg b/user_weather_map/static/description/assets/icons/brand-pair.svg new file mode 100644 index 000000000..d8db7fc1e --- /dev/null +++ b/user_weather_map/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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/close-icon.svg b/user_weather_map/static/description/assets/icons/close-icon.svg new file mode 100644 index 000000000..df8cce37a --- /dev/null +++ b/user_weather_map/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + 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/collabarate-icon.svg b/user_weather_map/static/description/assets/icons/collabarate-icon.svg new file mode 100644 index 000000000..dd4e10518 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + 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/cybro-logo.png b/user_weather_map/static/description/assets/icons/cybro-logo.png new file mode 100644 index 000000000..ff4b78220 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/cybro-logo.png differ diff --git a/user_weather_map/static/description/assets/icons/down.svg b/user_weather_map/static/description/assets/icons/down.svg new file mode 100644 index 000000000..f21c36271 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file 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/faq.png b/user_weather_map/static/description/assets/icons/faq.png new file mode 100644 index 000000000..4250b5b81 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/faq.png differ diff --git a/user_weather_map/static/description/assets/icons/feature-icon.svg b/user_weather_map/static/description/assets/icons/feature-icon.svg new file mode 100644 index 000000000..fa0ea6850 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/feature.png b/user_weather_map/static/description/assets/icons/feature.png new file mode 100644 index 000000000..ac7a785c0 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/feature.png differ diff --git a/user_weather_map/static/description/assets/icons/gear.svg b/user_weather_map/static/description/assets/icons/gear.svg new file mode 100644 index 000000000..0cc66b6ea --- /dev/null +++ b/user_weather_map/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/hero.gif b/user_weather_map/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..7b220b9be Binary files /dev/null and b/user_weather_map/static/description/assets/icons/hero.gif differ diff --git a/user_weather_map/static/description/assets/icons/hire-odoo.svg b/user_weather_map/static/description/assets/icons/hire-odoo.svg new file mode 100644 index 000000000..e1ac089b0 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + 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/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/life-ring-icon.svg b/user_weather_map/static/description/assets/icons/life-ring-icon.svg new file mode 100644 index 000000000..3ae6e1d89 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + 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/mail.svg b/user_weather_map/static/description/assets/icons/mail.svg new file mode 100644 index 000000000..1eedde695 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + 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/notes.png b/user_weather_map/static/description/assets/icons/notes.png new file mode 100644 index 000000000..ee5e95404 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/notes.png differ diff --git a/user_weather_map/static/description/assets/icons/notification icon.svg b/user_weather_map/static/description/assets/icons/notification icon.svg new file mode 100644 index 000000000..053189973 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/odoo-consultancy.svg b/user_weather_map/static/description/assets/icons/odoo-consultancy.svg new file mode 100644 index 000000000..e05f65bde --- /dev/null +++ b/user_weather_map/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/user_weather_map/static/description/assets/icons/odoo-licencing.svg b/user_weather_map/static/description/assets/icons/odoo-licencing.svg new file mode 100644 index 000000000..2606c88b0 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/user_weather_map/static/description/assets/icons/odoo-logo.png b/user_weather_map/static/description/assets/icons/odoo-logo.png new file mode 100644 index 000000000..0e4d0eb5a Binary files /dev/null and b/user_weather_map/static/description/assets/icons/odoo-logo.png differ diff --git a/user_weather_map/static/description/assets/icons/patter.svg b/user_weather_map/static/description/assets/icons/patter.svg new file mode 100644 index 000000000..25c9c0a8f --- /dev/null +++ b/user_weather_map/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/pattern1.png b/user_weather_map/static/description/assets/icons/pattern1.png new file mode 100644 index 000000000..09ab0fb2d Binary files /dev/null and b/user_weather_map/static/description/assets/icons/pattern1.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-piece-icon.svg b/user_weather_map/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100644 index 000000000..3e9ad9373 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/replace-icon.svg b/user_weather_map/static/description/assets/icons/replace-icon.svg new file mode 100644 index 000000000..d0e3a7af1 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/screenshot-main.png b/user_weather_map/static/description/assets/icons/screenshot-main.png new file mode 100644 index 000000000..575f8e676 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/screenshot-main.png differ diff --git a/user_weather_map/static/description/assets/icons/screenshot.png b/user_weather_map/static/description/assets/icons/screenshot.png new file mode 100644 index 000000000..cef272529 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/screenshot.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/skype-fill.svg b/user_weather_map/static/description/assets/icons/skype-fill.svg new file mode 100644 index 000000000..c17423639 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/skype.png b/user_weather_map/static/description/assets/icons/skype.png new file mode 100644 index 000000000..51b409fb3 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/skype.png differ diff --git a/user_weather_map/static/description/assets/icons/skype.svg b/user_weather_map/static/description/assets/icons/skype.svg new file mode 100644 index 000000000..df3dad39b --- /dev/null +++ b/user_weather_map/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/user_weather_map/static/description/assets/icons/star-1.svg b/user_weather_map/static/description/assets/icons/star-1.svg new file mode 100644 index 000000000..7e55ab162 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/star-2.svg b/user_weather_map/static/description/assets/icons/star-2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/user_weather_map/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/user_weather_map/static/description/assets/icons/support.png b/user_weather_map/static/description/assets/icons/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/support.png differ diff --git a/user_weather_map/static/description/assets/icons/test-1 - Copy.png b/user_weather_map/static/description/assets/icons/test-1 - Copy.png new file mode 100644 index 000000000..f6a902663 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/test-1 - Copy.png differ diff --git a/user_weather_map/static/description/assets/icons/test-1.png b/user_weather_map/static/description/assets/icons/test-1.png new file mode 100644 index 000000000..0908add2b Binary files /dev/null and b/user_weather_map/static/description/assets/icons/test-1.png differ diff --git a/user_weather_map/static/description/assets/icons/test-2.png b/user_weather_map/static/description/assets/icons/test-2.png new file mode 100644 index 000000000..4671fe91e Binary files /dev/null and b/user_weather_map/static/description/assets/icons/test-2.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/translate.svg b/user_weather_map/static/description/assets/icons/translate.svg new file mode 100644 index 000000000..af9c8a1aa --- /dev/null +++ b/user_weather_map/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/video.png b/user_weather_map/static/description/assets/icons/video.png new file mode 100644 index 000000000..576705b17 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/video.png differ diff --git a/user_weather_map/static/description/assets/icons/whatsapp.png b/user_weather_map/static/description/assets/icons/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/user_weather_map/static/description/assets/icons/whatsapp.png differ diff --git a/user_weather_map/static/description/assets/icons/wrench-icon.svg b/user_weather_map/static/description/assets/icons/wrench-icon.svg new file mode 100644 index 000000000..174b5a465 --- /dev/null +++ b/user_weather_map/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + 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/modules/banner1.jpg b/user_weather_map/static/description/assets/modules/banner1.jpg new file mode 100644 index 000000000..2a6617744 Binary files /dev/null and b/user_weather_map/static/description/assets/modules/banner1.jpg differ diff --git a/user_weather_map/static/description/assets/modules/banner2.png b/user_weather_map/static/description/assets/modules/banner2.png new file mode 100644 index 000000000..98b9ad696 Binary files /dev/null and b/user_weather_map/static/description/assets/modules/banner2.png differ diff --git a/user_weather_map/static/description/assets/modules/banner3.jpg b/user_weather_map/static/description/assets/modules/banner3.jpg new file mode 100644 index 000000000..1623d9406 Binary files /dev/null and b/user_weather_map/static/description/assets/modules/banner3.jpg differ diff --git a/user_weather_map/static/description/assets/modules/banner4.jpg b/user_weather_map/static/description/assets/modules/banner4.jpg new file mode 100644 index 000000000..ac2ec7832 Binary files /dev/null and b/user_weather_map/static/description/assets/modules/banner4.jpg differ diff --git a/user_weather_map/static/description/assets/modules/banner5.jpg b/user_weather_map/static/description/assets/modules/banner5.jpg new file mode 100644 index 000000000..eda1c63c0 Binary files /dev/null and b/user_weather_map/static/description/assets/modules/banner5.jpg differ diff --git a/user_weather_map/static/description/assets/modules/banner6.png b/user_weather_map/static/description/assets/modules/banner6.png new file mode 100644 index 000000000..b540ce95e Binary files /dev/null and b/user_weather_map/static/description/assets/modules/banner6.png differ diff --git a/user_weather_map/static/description/assets/screenshots/screenshot1.png b/user_weather_map/static/description/assets/screenshots/screenshot1.png new file mode 100644 index 000000000..b5eee5c53 Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/screenshot1.png differ diff --git a/user_weather_map/static/description/assets/screenshots/screenshot2.png b/user_weather_map/static/description/assets/screenshots/screenshot2.png new file mode 100644 index 000000000..9988222d3 Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/screenshot2.png differ diff --git a/user_weather_map/static/description/assets/screenshots/screenshot3.png b/user_weather_map/static/description/assets/screenshots/screenshot3.png new file mode 100644 index 000000000..371821b2f Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/screenshot3.png differ diff --git a/user_weather_map/static/description/assets/screenshots/screenshot4.png b/user_weather_map/static/description/assets/screenshots/screenshot4.png new file mode 100644 index 000000000..86012f909 Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/screenshot4.png differ diff --git a/user_weather_map/static/description/assets/screenshots/screenshot5.png b/user_weather_map/static/description/assets/screenshots/screenshot5.png new file mode 100644 index 000000000..ff16610eb Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/screenshot5.png differ diff --git a/user_weather_map/static/description/assets/screenshots/screenshot6.png b/user_weather_map/static/description/assets/screenshots/screenshot6.png new file mode 100644 index 000000000..c05a85c94 Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/screenshot6.png differ diff --git a/user_weather_map/static/description/assets/screenshots/screenshot7.png b/user_weather_map/static/description/assets/screenshots/screenshot7.png new file mode 100644 index 000000000..83babb416 Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/screenshot7.png differ diff --git a/user_weather_map/static/description/assets/screenshots/screenshot8.png b/user_weather_map/static/description/assets/screenshots/screenshot8.png new file mode 100644 index 000000000..c6de866ad Binary files /dev/null and b/user_weather_map/static/description/assets/screenshots/screenshot8.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..63aa3b0f5 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..a5821ef6c Binary files /dev/null and b/user_weather_map/static/description/icon.png differ diff --git a/user_weather_map/static/description/images/arrows-transparent.png b/user_weather_map/static/description/images/arrows-transparent.png new file mode 100644 index 000000000..f2973bb02 Binary files /dev/null and b/user_weather_map/static/description/images/arrows-transparent.png differ diff --git a/user_weather_map/static/description/images/cybro_logo.png b/user_weather_map/static/description/images/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/user_weather_map/static/description/images/cybro_logo.png differ diff --git a/user_weather_map/static/description/images/icons/ecom.png b/user_weather_map/static/description/images/icons/ecom.png new file mode 100644 index 000000000..6e720d50e Binary files /dev/null and b/user_weather_map/static/description/images/icons/ecom.png differ diff --git a/user_weather_map/static/description/images/icons/education.png b/user_weather_map/static/description/images/icons/education.png new file mode 100644 index 000000000..f0de98eb0 Binary files /dev/null and b/user_weather_map/static/description/images/icons/education.png differ diff --git a/user_weather_map/static/description/images/icons/hotel.png b/user_weather_map/static/description/images/icons/hotel.png new file mode 100644 index 000000000..917c6a63e Binary files /dev/null and b/user_weather_map/static/description/images/icons/hotel.png differ diff --git a/user_weather_map/static/description/images/icons/manufacturing.png b/user_weather_map/static/description/images/icons/manufacturing.png new file mode 100644 index 000000000..68c3722f8 Binary files /dev/null and b/user_weather_map/static/description/images/icons/manufacturing.png differ diff --git a/user_weather_map/static/description/images/icons/pos.png b/user_weather_map/static/description/images/icons/pos.png new file mode 100644 index 000000000..600bfe4f9 Binary files /dev/null and b/user_weather_map/static/description/images/icons/pos.png differ diff --git a/user_weather_map/static/description/images/icons/restaurant.png b/user_weather_map/static/description/images/icons/restaurant.png new file mode 100644 index 000000000..680acf29e Binary files /dev/null and b/user_weather_map/static/description/images/icons/restaurant.png differ diff --git a/user_weather_map/static/description/images/icons/service.png b/user_weather_map/static/description/images/icons/service.png new file mode 100644 index 000000000..bfbe7a6d2 Binary files /dev/null and b/user_weather_map/static/description/images/icons/service.png differ diff --git a/user_weather_map/static/description/images/icons/trading.png b/user_weather_map/static/description/images/icons/trading.png new file mode 100644 index 000000000..a741219b5 Binary files /dev/null and b/user_weather_map/static/description/images/icons/trading.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..a175ad5b9 --- /dev/null +++ b/user_weather_map/static/description/index.html @@ -0,0 +1,1099 @@ + + + + + + User Weather Notification + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+ + + + +
+
+ +
+
+
+
+

+ A Module For User Weather Notification. +

+

User Weather Notification +

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

Key + Highlights

+
+
+
+
+ +
+
+ Shows Weather Details +
+

+ The user will get the weather notification. +

+
+
+
+
+
+ +
+
+ Configure Weather. +
+

+ The user can configure their weather + notification. +

+
+
+
+
+ +
+
+
+ User Weather Notification +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Configuration on + + Users. +

+
+
+

+ Settings -> Users + -> Weather + Settings.There is a + page for Weather Settings. +

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

+ Set up + + API Key. +

+
+
+

+ Specify the API Key of + openweathermap. +

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

+ Create Account in + + Openweathermap. +

+
+
+

+ 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. +

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

+ selecting + + My + API Keys. +

+
+
+

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

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

+ retrieve your + + API Key. +

+
+
+

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

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

+ Set up + + Location. +

+
+
+

+ After specifying your API key, + you can now set up your + location. + Manual or Auto,For manual + location user must enter a valid + city of openweathermap api. +

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

+ weather + + Notification. +

+
+
+

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

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

+ Warning if No + + Notification. +

+
+
+

+ There will be a Warning message + if the user has not configured + the API key or Location. +

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

+ Available in Odoo Community and + Enterprise.

+
+ +
+
+
+
+
+
+ +
+

+ Weather notification in a Single Click.

+
+ +
+
+
+
+
+
+ +
+

+ Configure Weather Notification.

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

+ The User Weather Notification + app integrates real-time weather + updates and notifications into the + Odoo platform. It allows users to monitor weather + conditions for selected locations directly + from their Odoo interface. +

+
+
+ +
+ +
+

+ Yes, you need an API key + from a supported weather data provider (e.g., OpenWeatherMap). + You can enter this key in the app's configuration + settings to enable weather fetching. +

+
+
+ +
+ +
+

+ Weather information is + displayed in the systray (top-right corner of the Odoo interface) + and/or through notification popups + based on configured preferences. +

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

+ Latest Release 18.0.1.0.0 +

+ + 15th July 2025 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + 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..990887081 --- /dev/null +++ b/user_weather_map/static/src/js/WeatherMenu.js @@ -0,0 +1,65 @@ +/** @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, useState } from '@odoo/owl'; +import { registry } from '@web/core/registry'; +import { session } from "@web/session"; +import { rpc } from "@web/core/network/rpc"; +/** + * Menu item appended in the systray part of the navbar + */ +export class WeatherMenu extends Component { + setup() { + super.setup(); + this.state = useState({ + weather_data: null, // Initialize with null or empty object + }); + + // Fetch the weather data initially + this.fetch_data(); + } + + async fetch_data() { + /** Fetching weather data using RPC call **/ + try { + const data = await rpc('/weather/notification/check', {}); + this.state.weather_data = data; // Update state with fetched data + this.updateWeatherData(); + } catch (error) { + console.error("Failed to fetch weather data", error); + } + } + + updateWeatherData() { + /** Updating weather data after fetching **/ + const weather_data = this.state.weather_data; + + if (!weather_data || weather_data.hasOwnProperty("error")) { + // Handle error or invalid data + this.session = this.session || {}; // Ensure session object exists + this.session.name = ''; + this.session.main = ''; + this.session.description = 'Provide a valid API key.'; + this.session.temp = ''; + } else { + // Initialize session if undefined + this.session = this.session || {}; + // Properly update session values with fetched data + this.session.name = weather_data.name; + this.session.main = weather_data.weather[0].main; + this.session.description = weather_data.weather[0].description; + this.session.temp = Math.round(weather_data.main.temp - 273.15); // Convert Kelvin to Celsius + } + } +}; +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..55e0a36cc --- /dev/null +++ b/user_weather_map/static/src/xml/weather_notification_templates.xml @@ -0,0 +1,60 @@ + + + + + + + +
+ +
+ Card image cap +
+

+ +

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

+ + 0C +

+ + + +
+
+
+
+
+
+
+
+ + Warning! + Please configure your API key and Location in the Weather + settings. +
+
+
+
+
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 + + + + + + + + + + + + + +