diff --git a/mail_push_notification/README.rst b/mail_push_notification/README.rst new file mode 100644 index 000000000..150784912 --- /dev/null +++ b/mail_push_notification/README.rst @@ -0,0 +1,48 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Push Notification From ChatBox +============================== +* Push Notification From ChatBox is valuable for teams looking to streamline communication and enhance productivity within the Odoo platform. + +Configuration +============= +* Install the pyfcm python package +* Install our module and make sure that your instance served over https.Firebase is intent on being a highly secure solution, so they have chosen to require the use of a https for all communication and http is not working. +* After installation of module its important that allow the notification access in the webpage + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Lesser General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +Developer: (V17) Gokul P I , 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/mail_push_notification/__init__.py b/mail_push_notification/__init__.py new file mode 100755 index 000000000..9e5f5ab1d --- /dev/null +++ b/mail_push_notification/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/mail_push_notification/__manifest__.py b/mail_push_notification/__manifest__.py new file mode 100755 index 000000000..ee1ae8634 --- /dev/null +++ b/mail_push_notification/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + "name": "Push Notification From ChatBox", + 'version': '17.0.1.0.0', + 'category': 'Discuss,Extra Tools', + 'summary': 'With Push Notification From ChatBox, users can respond promptly' + ' to important messages, improving communication efficiency.', + 'description': 'Push Notification From ChatBox is valuable for teams ' + 'looking to streamline communication and enhance ' + 'productivity within the Odoo platform.', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + "depends": ["web", "mail"], + "data": [ + "security/ir.model.access.csv", + "views/res_config_settings_views.xml" + ], + 'assets': { + 'web.assets_backend': [ + "https://www.gstatic.com/firebasejs/8.4.3/firebase-app.js", + "https://www.gstatic.com/firebasejs/8.4.3/firebase-messaging.js", + "mail_push_notification/static/src/js/firebase.js", + ], + }, + "external_dependencies": {"python": ["pyfcm"]}, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/mail_push_notification/controllers/__init__.py b/mail_push_notification/controllers/__init__.py new file mode 100755 index 000000000..7c5feb144 --- /dev/null +++ b/mail_push_notification/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import mail_push_notification diff --git a/mail_push_notification/controllers/mail_push_notification.py b/mail_push_notification/controllers/mail_push_notification.py new file mode 100755 index 000000000..0c93bdd4b --- /dev/null +++ b/mail_push_notification/controllers/mail_push_notification.py @@ -0,0 +1,128 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import json +from odoo import http +from odoo.http import request + + +class MailPushNotification(http.Controller): + """Controller for handling push notifications using Firebase + Cloud Messaging""" + + @http.route('/firebase-messaging-sw.js', type='http', auth="public") + def firebase_http(self): + """Returns the Firebase service worker script. + :return: The Firebase service worker script. + :rtype: str""" + if request.env.company and request.env.company.push_notification: + firebase_js = """ + this.addEventListener('fetch', function(e) { + e.respondWith( + caches.match(e.request).then(function(response) { + return response || fetch(e.request); + }) + ); + }); + importScripts('https://www.gstatic.com/firebasejs/8.4.2/firebase-app.js'); + importScripts('https://www.gstatic.com/firebasejs/8.4.2/firebase-messaging.js'); + var firebaseConfig = { + apiKey: '%s', + authDomain: '%s', + projectId: '%s', + storageBucket: '%s', + messagingSenderId: '%s', + appId: '%s', + measurementId: '%s', + }; + firebase.initializeApp(firebaseConfig); + const messaging = firebase.messaging(); + messaging.setBackgroundMessageHandler(function(payload) { + const notificationTitle = "Background Message Title"; + const notificationOptions = { + body: payload.notification.body, + icon:'/mail_push_notification/static/description/icon.png', + }; + return self.registration.showNotification( + notificationTitle, + notificationOptions, + ); + }); + """ % ( + request.env.company.api_key, request.env.company.auth_domain, + request.env.company.project_id_firebase, + request.env.company.storage_bucket, + request.env.company.messaging_sender_id_firebase, + request.env.company.app_id_firebase, + request.env.company.measurement_id_firebase) + else: + firebase_js = """ + this.addEventListener('fetch', function(e) { + e.respondWith( + caches.match(e.request).then(function(response) { + return response || fetch(e.request); + }) + ); + }); + """ + return http.request.make_response(firebase_js, [ + ('Content-Type', 'text/javascript')]) + + @http.route('/push_notification', type='http', auth="public", + csrf=False) + def get_registration_tokens(self, **post): + """Handles registration tokens for push notifications. + Create a new registration token if it doesn't already exist + :param post: POST request data containing registration token. + :type post: dict + """ + user_notification = request.env['push.notification'].sudo().search( + [('register_id', '=', post.get('name'))], limit=1) + if not user_notification: + request.env['push.notification'].sudo().create({ + 'register_id': post.get('name'), + 'user_id': request.env.user.id + }) + + @http.route('/firebase_config_details', type='json', auth="public") + def send_datas(self): + """Sends Firebase configuration details. + :return: JSON containing Firebase configuration details. + :rtype: str""" + if request.env.company and request.env.company.push_notification: + return json.dumps({ + 'vapid': request.env.company.vapid, + 'config': { + 'apiKey': request.env.company.api_key, + 'authDomain': request.env.company.auth_domain, + 'projectId': request.env.company.project_id_firebase, + 'storageBucket': request.env.company.storage_bucket, + 'messagingSenderId': request.env.company.messaging_sender_id_firebase, + 'appId': request.env.company.app_id_firebase, + 'measurementId': request.env.company.measurement_id_firebase + } + }) + + @http.route('/firebase_credentials', type="json", auth="public") + def firebase_credentials(self, **kw): + """ Retrieve Firebase credentials for the current company.""" + return {'id': request.env.company.id, + 'push_notification': request.env.company.push_notification} diff --git a/mail_push_notification/doc/RELEASE_NOTES.md b/mail_push_notification/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..92e88ff57 --- /dev/null +++ b/mail_push_notification/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 01.12.2023 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for Push Notification From ChatBox diff --git a/mail_push_notification/models/__init__.py b/mail_push_notification/models/__init__.py new file mode 100755 index 000000000..47a182814 --- /dev/null +++ b/mail_push_notification/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import mail_thread +from . import push_notification +from . import res_company +from . import res_config_settings diff --git a/mail_push_notification/models/mail_thread.py b/mail_push_notification/models/mail_thread.py new file mode 100644 index 000000000..8c51dcb5d --- /dev/null +++ b/mail_push_notification/models/mail_thread.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from pyfcm import FCMNotification +from odoo import models + + +class MailThread(models.AbstractModel): + """Inherits MailThread to send notifications using chatterbox""" + _inherit = 'mail.thread' + + def _notify_thread(self, message, msg_vals=False, **kwargs): + """Supering the _notify_thread() function to fetch the details of the + chat message and push that message as a notification """ + res = super(MailThread, self)._notify_thread(message, + msg_vals=msg_vals, + **kwargs) + msg = message.read() + if self.env.company.push_notification and self.env.user.has_group( + 'base.group_user'): + try: + push_service = FCMNotification( + api_key=self.env.company.server_key) + receiver_id = False + domain = [] + if self.channel_type != 'channel': + for partner in self.channel_partner_ids: + if partner.id != msg[0]['author_id'][0]: + receiver_id = self.env['res.users'].search([( + 'partner_id', + '=', + partner.id)]) + if receiver_id: + domain = [('user_id', '=', + receiver_id.id)] + push_service.notify_multiple_devices( + registration_ids=[registration_id.register_id for + registration_id in + self.env['push.notification'].search( + domain)], + message_title='Send by ' + msg[0]['author_id'][1], + message_body=msg[0]['description'], + extra_notification_kwargs={ + 'click_action': '/web' + }) + except Exception: + pass + return res diff --git a/mail_push_notification/models/push_notification.py b/mail_push_notification/models/push_notification.py new file mode 100755 index 000000000..6c451b579 --- /dev/null +++ b/mail_push_notification/models/push_notification.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PushNotification(models.Model): + """Using this class create the registration id for the user to send + push notifications""" + _name = 'push.notification' + _description = 'Web Push Notification' + + user_id = fields.Many2one("res.users", string="Firebase User", + help="Corresponding Firebase User") + register_id = fields.Char(string="Registration Id", + help="Firebase Registration Token") diff --git a/mail_push_notification/models/res_company.py b/mail_push_notification/models/res_company.py new file mode 100644 index 000000000..6d355aa79 --- /dev/null +++ b/mail_push_notification/models/res_company.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ResCompany(models.Model): + """Inheriting this class to add the firebase credential need in config + settings and use the multi company feature""" + _inherit = 'res.company' + + push_notification = fields.Boolean(string='Enable Push Notification', + help="Enable Web Push Notification") + server_key = fields.Char(string="Server Key", + help="Server Key of the firebase") + vapid = fields.Char(string="Vapid", help='VapId of the firebase', + readonly=False) + api_key = fields.Char(string="Api Key", + help='Corresponding apiKey of firebase config', + readonly=False) + auth_domain = fields.Char(string="Auth Domain", + help='Corresponding authDomain of firebase ' + 'config') + project_id_firebase = fields.Char(string="Project Id", + help='Corresponding projectId of ' + 'firebase config') + storage_bucket = fields.Char(string="Storage Bucket", + help='Corresponding storageBucket of ' + 'firebase config') + messaging_sender_id_firebase = fields.Char(string="Messaging Sender Id", + help='Corresponding ' + 'messagingSenderId of ' + 'firebase config') + app_id_firebase = fields.Char(string="App Id", + help='Corresponding appId of firebase config') + measurement_id_firebase = fields.Char(string="Measurement Id", + help='Corresponding measurementId ' + 'of firebase config') diff --git a/mail_push_notification/models/res_config_settings.py b/mail_push_notification/models/res_config_settings.py new file mode 100644 index 000000000..ec85c9fef --- /dev/null +++ b/mail_push_notification/models/res_config_settings.py @@ -0,0 +1,116 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Gokul PI () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from pyfcm import FCMNotification +from odoo import fields, models, _ + + +class ResConfigSettings(models.TransientModel): + """Inheriting the ResConfigSettings to add the firebase config details + to push notifications """ + _inherit = 'res.config.settings' + + push_notification = fields.Boolean(string='Enable Push Notification', + help="Enable Web Push Notification", + related='company_id.push_notification', + readonly=False) + server_key = fields.Char(string="Server Key", + help="Server Key of the firebase", + related='company_id.server_key', readonly=False) + vapid = fields.Char(string="Vapid", help='VapId of the firebase', + related='company_id.vapid', readonly=False) + api_key = fields.Char(string="Api Key", + help='Corresponding apiKey of firebase config', + related='company_id.api_key', readonly=False) + auth_domain = fields.Char(string="Auth Domain", + help='Corresponding authDomain of firebase ' + 'config', + related='company_id.auth_domain', readonly=False) + project_id_firebase = fields.Char(string="Project Id", + help='Corresponding projectId of ' + 'firebase config', + related='company_id.project_id_firebase', + readonly=False) + storage_bucket = fields.Char(string="Storage Bucket", + help='Corresponding storageBucket of ' + 'firebase config', + related='company_id.storage_bucket', + readonly=False) + messaging_sender_id_firebase = fields.Char(string="Messaging Sender Id", + help='Corresponding ' + 'messagingSenderId of ' + 'firebase config', + related='company_id' + '.messaging_sender_id_firebase', + readonly=False) + app_id_firebase = fields.Char(string="App Id", + help='Corresponding appId of firebase config', + related='company_id.app_id_firebase', + readonly=False) + measurement_id_firebase = fields.Char(string="Measurement Id", + help='Corresponding measurementId ' + 'of firebase config', + related='company_id' + '.measurement_id_firebase', + readonly=False) + + def test_connection(self): + """Test connection to firebase using the firebase credentials""" + if self.env.company.push_notification: + try: + push_service = FCMNotification( + api_key=self.env.company.server_key) + registration_ids = self.env['push.notification'].sudo().search( + [('user_id', '=', self.env.user.id)]) + push_service.notify_multiple_devices( + registration_ids=[registration_id.register_id for + registration_id in registration_ids], + message_title='Test Connection', + message_body='Successfully', + extra_notification_kwargs={ + 'click_action': '/web' + }) + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'type': 'success', + 'message': _("Connection successfully established"), + 'next': { + 'type': 'ir.actions.client', + 'tag': 'reload_context', + }, + } + } + except: + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'type': 'danger', + 'message': _( + "Failed to connect with firebase"), + 'next': { + 'type': 'ir.actions.client', + 'tag': 'reload_context', + }, + } + } diff --git a/mail_push_notification/security/ir.model.access.csv b/mail_push_notification/security/ir.model.access.csv new file mode 100755 index 000000000..1ab429df2 --- /dev/null +++ b/mail_push_notification/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_push_notification_user,access.push.notification.user,model_push_notification,base.group_user,1,1,1,1 diff --git a/mail_push_notification/static/description/assets/icons/capture (1).png b/mail_push_notification/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/capture (1).png differ diff --git a/mail_push_notification/static/description/assets/icons/check.png b/mail_push_notification/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/check.png differ diff --git a/mail_push_notification/static/description/assets/icons/chevron.png b/mail_push_notification/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/chevron.png differ diff --git a/mail_push_notification/static/description/assets/icons/cogs.png b/mail_push_notification/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/cogs.png differ diff --git a/mail_push_notification/static/description/assets/icons/consultation.png b/mail_push_notification/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/consultation.png differ diff --git a/mail_push_notification/static/description/assets/icons/ecom-black.png b/mail_push_notification/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/ecom-black.png differ diff --git a/mail_push_notification/static/description/assets/icons/education-black.png b/mail_push_notification/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/education-black.png differ diff --git a/mail_push_notification/static/description/assets/icons/hotel-black.png b/mail_push_notification/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/hotel-black.png differ diff --git a/mail_push_notification/static/description/assets/icons/img.png b/mail_push_notification/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/img.png differ diff --git a/mail_push_notification/static/description/assets/icons/license.png b/mail_push_notification/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/license.png differ diff --git a/mail_push_notification/static/description/assets/icons/lifebuoy.png b/mail_push_notification/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/lifebuoy.png differ diff --git a/mail_push_notification/static/description/assets/icons/logo.png b/mail_push_notification/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/logo.png differ diff --git a/mail_push_notification/static/description/assets/icons/manufacturing-black.png b/mail_push_notification/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/manufacturing-black.png differ diff --git a/mail_push_notification/static/description/assets/icons/photo-capture.png b/mail_push_notification/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/photo-capture.png differ diff --git a/mail_push_notification/static/description/assets/icons/pos-black.png b/mail_push_notification/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/pos-black.png differ diff --git a/mail_push_notification/static/description/assets/icons/puzzle.png b/mail_push_notification/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/puzzle.png differ diff --git a/mail_push_notification/static/description/assets/icons/restaurant-black.png b/mail_push_notification/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/restaurant-black.png differ diff --git a/mail_push_notification/static/description/assets/icons/service-black.png b/mail_push_notification/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/service-black.png differ diff --git a/mail_push_notification/static/description/assets/icons/trading-black.png b/mail_push_notification/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/trading-black.png differ diff --git a/mail_push_notification/static/description/assets/icons/training.png b/mail_push_notification/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/training.png differ diff --git a/mail_push_notification/static/description/assets/icons/update.png b/mail_push_notification/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/update.png differ diff --git a/mail_push_notification/static/description/assets/icons/user.png b/mail_push_notification/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/user.png differ diff --git a/mail_push_notification/static/description/assets/icons/wrench.png b/mail_push_notification/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/mail_push_notification/static/description/assets/icons/wrench.png differ diff --git a/mail_push_notification/static/description/assets/misc/Cybrosys R.png b/mail_push_notification/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/Cybrosys R.png differ diff --git a/mail_push_notification/static/description/assets/misc/categories.png b/mail_push_notification/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/categories.png differ diff --git a/mail_push_notification/static/description/assets/misc/check-box.png b/mail_push_notification/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/check-box.png differ diff --git a/mail_push_notification/static/description/assets/misc/compass.png b/mail_push_notification/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/compass.png differ diff --git a/mail_push_notification/static/description/assets/misc/corporate.png b/mail_push_notification/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/corporate.png differ diff --git a/mail_push_notification/static/description/assets/misc/customer-support.png b/mail_push_notification/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/customer-support.png differ diff --git a/mail_push_notification/static/description/assets/misc/cybrosys-logo.png b/mail_push_notification/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/cybrosys-logo.png differ diff --git a/mail_push_notification/static/description/assets/misc/email.svg b/mail_push_notification/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/mail_push_notification/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mail_push_notification/static/description/assets/misc/features.png b/mail_push_notification/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/features.png differ diff --git a/mail_push_notification/static/description/assets/misc/logo.png b/mail_push_notification/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/logo.png differ diff --git a/mail_push_notification/static/description/assets/misc/phone.svg b/mail_push_notification/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/mail_push_notification/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/mail_push_notification/static/description/assets/misc/pictures.png b/mail_push_notification/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/pictures.png differ diff --git a/mail_push_notification/static/description/assets/misc/pie-chart.png b/mail_push_notification/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/pie-chart.png differ diff --git a/mail_push_notification/static/description/assets/misc/right-arrow.png b/mail_push_notification/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/right-arrow.png differ diff --git a/mail_push_notification/static/description/assets/misc/star (1) 2.svg b/mail_push_notification/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/mail_push_notification/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/mail_push_notification/static/description/assets/misc/star.png b/mail_push_notification/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/star.png differ diff --git a/mail_push_notification/static/description/assets/misc/support (1) 1.svg b/mail_push_notification/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/mail_push_notification/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/mail_push_notification/static/description/assets/misc/support-email.svg b/mail_push_notification/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/mail_push_notification/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/mail_push_notification/static/description/assets/misc/support.png b/mail_push_notification/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/support.png differ diff --git a/mail_push_notification/static/description/assets/misc/tick-mark.svg b/mail_push_notification/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/mail_push_notification/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/mail_push_notification/static/description/assets/misc/whatsapp 1.svg b/mail_push_notification/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/mail_push_notification/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/mail_push_notification/static/description/assets/misc/whatsapp.png b/mail_push_notification/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/mail_push_notification/static/description/assets/misc/whatsapp.png differ diff --git a/mail_push_notification/static/description/assets/misc/whatsapp.svg b/mail_push_notification/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/mail_push_notification/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mail_push_notification/static/description/assets/modules/1.png b/mail_push_notification/static/description/assets/modules/1.png new file mode 100644 index 000000000..ba1058c42 Binary files /dev/null and b/mail_push_notification/static/description/assets/modules/1.png differ diff --git a/mail_push_notification/static/description/assets/modules/2.png b/mail_push_notification/static/description/assets/modules/2.png new file mode 100644 index 000000000..6949185dd Binary files /dev/null and b/mail_push_notification/static/description/assets/modules/2.png differ diff --git a/mail_push_notification/static/description/assets/modules/3.png b/mail_push_notification/static/description/assets/modules/3.png new file mode 100644 index 000000000..4e506f79b Binary files /dev/null and b/mail_push_notification/static/description/assets/modules/3.png differ diff --git a/mail_push_notification/static/description/assets/modules/4.png b/mail_push_notification/static/description/assets/modules/4.png new file mode 100644 index 000000000..e78427938 Binary files /dev/null and b/mail_push_notification/static/description/assets/modules/4.png differ diff --git a/mail_push_notification/static/description/assets/modules/5.gif b/mail_push_notification/static/description/assets/modules/5.gif new file mode 100644 index 000000000..8f40aab85 Binary files /dev/null and b/mail_push_notification/static/description/assets/modules/5.gif differ diff --git a/mail_push_notification/static/description/assets/modules/5.png b/mail_push_notification/static/description/assets/modules/5.png new file mode 100755 index 000000000..272ec20f9 Binary files /dev/null and b/mail_push_notification/static/description/assets/modules/5.png differ diff --git a/mail_push_notification/static/description/assets/modules/6.png b/mail_push_notification/static/description/assets/modules/6.png new file mode 100644 index 000000000..7d5c3154f Binary files /dev/null and b/mail_push_notification/static/description/assets/modules/6.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/1.png b/mail_push_notification/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..af5a93010 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/1.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/10.png b/mail_push_notification/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..cd55f0b6b Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/10.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/11.png b/mail_push_notification/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..ae76ac2c2 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/11.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/12.png b/mail_push_notification/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..b1a5a5a7b Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/12.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/13.png b/mail_push_notification/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..1559c87c4 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/13.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/14.png b/mail_push_notification/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..3baca447a Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/14.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/15.png b/mail_push_notification/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..4bc597737 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/15.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/16.png b/mail_push_notification/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..f4bf9618f Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/16.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/17.png b/mail_push_notification/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..13ae9f485 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/17.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/18.png b/mail_push_notification/static/description/assets/screenshots/18.png new file mode 100644 index 000000000..0422c3981 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/18.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/19.png b/mail_push_notification/static/description/assets/screenshots/19.png new file mode 100644 index 000000000..88ad91d9c Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/19.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/2.png b/mail_push_notification/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..06273b481 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/2.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/20.png b/mail_push_notification/static/description/assets/screenshots/20.png new file mode 100644 index 000000000..b31e2ed3a Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/20.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/21.png b/mail_push_notification/static/description/assets/screenshots/21.png new file mode 100644 index 000000000..6dcaa80bc Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/21.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/22.png b/mail_push_notification/static/description/assets/screenshots/22.png new file mode 100644 index 000000000..b7c4fb501 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/22.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/23.png b/mail_push_notification/static/description/assets/screenshots/23.png new file mode 100644 index 000000000..bd85647b3 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/23.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/24.png b/mail_push_notification/static/description/assets/screenshots/24.png new file mode 100644 index 000000000..7afae227b Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/24.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/3.png b/mail_push_notification/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..c80d8ceb6 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/3.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/4.png b/mail_push_notification/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..56838701a Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/4.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/5.png b/mail_push_notification/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..1e5a8c458 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/5.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/6.png b/mail_push_notification/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..647c8f92e Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/6.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/7.png b/mail_push_notification/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..947fead97 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/7.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/8.png b/mail_push_notification/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..c26950122 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/8.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/9.png b/mail_push_notification/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..1e3d6bb56 Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/9.png differ diff --git a/mail_push_notification/static/description/assets/screenshots/hero.gif b/mail_push_notification/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..55688866b Binary files /dev/null and b/mail_push_notification/static/description/assets/screenshots/hero.gif differ diff --git a/mail_push_notification/static/description/banner.jpg b/mail_push_notification/static/description/banner.jpg new file mode 100644 index 000000000..1e087eed6 Binary files /dev/null and b/mail_push_notification/static/description/banner.jpg differ diff --git a/mail_push_notification/static/description/icon.png b/mail_push_notification/static/description/icon.png new file mode 100644 index 000000000..ea07c1bc8 Binary files /dev/null and b/mail_push_notification/static/description/icon.png differ diff --git a/mail_push_notification/static/description/index.html b/mail_push_notification/static/description/index.html new file mode 100755 index 000000000..0fa50b19a --- /dev/null +++ b/mail_push_notification/static/description/index.html @@ -0,0 +1,1126 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Push Notification From ChatBox

+

+ Push Notification From ChatBox Provide Alerts To Users When + They Receive New Message From The Chatter. +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Real-time Alerts: +

+

Users receive + instant notifications on their devices (such as + desktop or mobile) as soon as a new message + arrives in their Odoo inbox.

+
+
+
+
+
+
+ +
+
+

+ Message Preview:

+

This involves + crafting concise and compelling content that + provides users with a clear understanding of + the notification's purpose.

+
+
+
+
+
+
+ +
+
+

+ Reduced Response Time:

+

With instant + notifications, users can respond promptly to + important messages, improving communication + efficiency and effectiveness

+
+
+
+
+
+
+ +
+
+

+ Compatible with both Odoo 17.0 Community and + Enterprise Editions. +

+
+
+
+
+
+
+ +
+
+

+ Privacy and Security: +

+

The + notifications are secure and respect user + privacy, as they are confined within the Odoo + environment.

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

+ First go to Firebase + console Create a Project if you don't + have any project. +

+
+
+
+
+
+
+ +
+
+

+ Set the name for the project and Continue +

+
+
+
+
+
+
+ +
+
+

+ Make sure that enabled the Google Analytics + for this project and click the Continue and + Create the project.

+
+
+
+
+
+
+ +
+
+

+ Then you need to create web app in that + project for that click the web app icon in + the project like shown below. +

+
+
+
+
+
+
+ +
+
+

+ Set the name for the app and register the + app. +

+
+
+
+
+
+
+ +
+
+

+ Here you can see all the details we need + you can copy them and after that select npm + and click the Next Button +

+
+
+
+
+
+
+ +
+
+

+ After that you can click Next Button for + Install Firebase CLI +

+
+
+
+
+
+
+ +
+
+

+ After that click the Continue to console +

+
+
+
+
+
+
+ +
+
+

+ After that you can see the app inside the + project and click on the setting icon of + the app to see the details of that app +

+
+
+
+
+
+
+ +
+
+

+ You can see the credentials(not server key + and vapid) we need in odoo in the General + --> Your apps +

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

+ You can create the server key we need in + odoo.For that goto the Cloud Messaging --> + Cloud Messaging API (Legacy) --> 3 dots + -->Manage API in Google Cloud Console --> + Enable the Cloud Messaging +

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

+ After that you can see the Server key in Cloud + Messaging API (Legacy) +

+
+
+
+
+
+
+ +
+
+

+ Now we need to create a Vapid goto the Cloud + Messaging --> Web configuration --> Generate + Key pair +

+
+
+
+
+
+
+ +
+
+

+ After that you can see the public key of the + Vap id Cloud Messaging --> Web configuration +

+
+
+
+
+
+
+ +
+
+

+ Goto the General Settings --> Firebase Push + Notification --> enable the 'Enable Push + Notification' then you can set the credential +

+
+
+
+
+
+
+ +
+
+

+ Its very important that You must Allow + the notification in the web browser + +

+
+
+
+
+
+
+ +
+
+

+ If you are using firefox browser you need + to allow the notification from clicking top + of the browser and allow like in the above + image + +

+
+
+
+
+
+
+ +
+
+

+ If you are using Brave browser you need + to enable Google Services for push + messaging for that goto the brave://settings/privacy + in brave and enable 'Use Google services + for push messaging' like shown in the above + image + +

+
+
+
+
+
+
+ +
+
+

+ After Allowing the notification access in the + browser you can click the "TEST CONNECTION" + Button +

+
+
+
+
+
+
+ +
+
+

+ Then you can see a notification on the system, + and you can see a green popup +

+
+
+
+
+
+
+ +
+
+

+ After that you can send message from the + chatBox module or in the discuss module +

+
+
+
+
+
+
+ +
+
+

+ Then you can see a popup notification in the + other user and when you click on that it will + be redirected to the odoo instance +

+
+
+
+
+ + +
+
+
    +
  • + Push + Notification From ChatBox in Odoo provide + instant alerts to users when they receive new + messages within the platform +
  • +
  • + With Push + Notification From ChatBox, users can respond + promptly to important messages,improving + communication efficiency. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:1st Dec 2023 +
+

+ Initial Commit for Push Notification From + ChatBox

+
+
+
+
+
+
+
+

+ 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/mail_push_notification/static/src/js/firebase.js b/mail_push_notification/static/src/js/firebase.js new file mode 100755 index 000000000..f0466d444 --- /dev/null +++ b/mail_push_notification/static/src/js/firebase.js @@ -0,0 +1,89 @@ +/** @odoo-module **/ + import { jsonrpc } from "@web/core/network/rpc_service"; + /** + * Odoo module for handling Firebase push notifications. + * + * This module initializes Firebase messaging and handles push notifications + * for the current session's company. It also registers the service worker for + * handling notifications if the company has push notifications enabled. + * + * @module mail_push_notification + */ + var vapid = ''; + var firebaseConfig = {}; + var push_notification = false; + /** + * Sends an RPC query to retrieve push notification settings for the current company. + * + * @function + * @returns {Promise} A promise that resolves with the push notification settings. + */ + jsonrpc("/firebase_credentials", {}).then(function(data) { + if (data) { + if (data.push_notification) { + push_notification = true; + if ("serviceWorker" in navigator) { + navigator.serviceWorker.register("/firebase-messaging-sw.js").then(function () {}); + } + } + } + }); + jsonrpc("/firebase_config_details", {}).then(function (data) { + if (data) { + var json = JSON.parse(data); + vapid = json.vapid; + firebaseConfig = json.config; + /** + * Initializes Firebase messaging and sets up event listeners for incoming messages. + * + * @function + */ + firebase.initializeApp(firebaseConfig); + const messaging = firebase.messaging(); + /** + * Handles incoming push notification messages. + * + * @function + * @param {Object} payload - The notification payload. + */ + messaging.onMessage((payload) => { + const notificationOptions = { + body: payload.notification.body, + }; + let notification = payload.notification; + navigator.serviceWorker.getRegistrations().then((registration) => { + registration[0].showNotification(notification.title, notificationOptions); + }); + }); + /** + * Requests permission for receiving push notifications and retrieves the registration token. + * + * @function + */ + messaging.requestPermission().then(function () { + /** + * Retrieves the registration token and sends it to the server for subscription. + * + * @function + * @param {string} vapidKey - The VAPID key for authentication. + */ + messaging.getToken({ vapidKey: vapid }).then((currentToken) => { + if (currentToken) { + /** + * Sends a POST request to the server with the registration token. + * + * @function + * @param {string} token - The registration token. + */ + $.post("/push_notification", { + name: currentToken + }); + } else { + console.log('No registration token found'); + } + }).catch((err) => { + console.log('There is an error has occurred while attempting to retrieve the token.', err); + }); + }); + } + }); diff --git a/mail_push_notification/views/res_config_settings_views.xml b/mail_push_notification/views/res_config_settings_views.xml new file mode 100755 index 000000000..50df5b276 --- /dev/null +++ b/mail_push_notification/views/res_config_settings_views.xml @@ -0,0 +1,114 @@ + + + + + + res.config.settings.view.form.inherit.mail.push.notification + + res.config.settings + + + + + + + +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+