diff --git a/infobip_whatsapp_integration/README.rst b/infobip_whatsapp_integration/README.rst new file mode 100644 index 000000000..fccc84d0d --- /dev/null +++ b/infobip_whatsapp_integration/README.rst @@ -0,0 +1,47 @@ +.. 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 + +Infobip Whatsapp Integration +============================ +Send whatsapp messages to the partner + +Installation +============ + - www.odoo.com/documentation/16.0/setup/install.html + - pip install infobip-api-python-sdk + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/15.0/legal/licenses/licenses.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V16) Jumana Jabin MP ,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 https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/infobip_whatsapp_integration/__init__.py b/infobip_whatsapp_integration/__init__.py new file mode 100644 index 000000000..0b6757580 --- /dev/null +++ b/infobip_whatsapp_integration/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Jabin MP (odoo@cybrosys.com) +# +# 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 models +from . import wizard diff --git a/infobip_whatsapp_integration/__manifest__.py b/infobip_whatsapp_integration/__manifest__.py new file mode 100644 index 000000000..867dc0e53 --- /dev/null +++ b/infobip_whatsapp_integration/__manifest__.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Jabin MP (odoo@cybrosys.com) +# +# 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': "Infobip Whatsapp Integration", + 'version': '16.0.1.0.0', + 'category': 'Extra Tools', + 'summary': 'Send whatsapp messages to the partner', + 'description': """This Module Helps you to Send a Whatsapp Message to your + Partners to send text message , send interactive list and button message , + send contact details and to send location of a user using infobip + Gateway.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'base_geolocalize', 'contacts'], + 'data': [ + 'security/ir.model.access.csv', + 'views/res_partner_views.xml', + 'views/res_config_settings_views.xml', + 'wizard/whatsapp_message_views.xml', + ], + 'external_dependencies': { + 'python': ['infobip-api-python-sdk'], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/infobip_whatsapp_integration/doc/RELEASE_NOTES.md b/infobip_whatsapp_integration/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..83038b091 --- /dev/null +++ b/infobip_whatsapp_integration/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 13.03.2024 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for Infobip Whatsapp Integration diff --git a/infobip_whatsapp_integration/models/__init__.py b/infobip_whatsapp_integration/models/__init__.py new file mode 100644 index 000000000..a4cde441b --- /dev/null +++ b/infobip_whatsapp_integration/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Jabin MP (odoo@cybrosys.com) +# +# 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 res_config_settings +from . import res_partner diff --git a/infobip_whatsapp_integration/models/res_config_settings.py b/infobip_whatsapp_integration/models/res_config_settings.py new file mode 100644 index 000000000..0a218aad6 --- /dev/null +++ b/infobip_whatsapp_integration/models/res_config_settings.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Jabin MP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################### +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + """ Inherited this module is to add fields for WhatsApp's + message-sending authentication """ + _inherit = "res.config.settings" + + api_key = fields.Char(string="API Key", + config_parameter='infobip_whatsapp_integration.' + 'api_key', + help="Enter your API Key for Infobip WhatsApp" + " integration.") + base_url = fields.Char(string="Base URL", + config_parameter='infobip_whatsapp_integration.' + 'base_url', + help="Enter the base URL for Infobip WhatsApp " + "integration.") + infobip_whatsapp = fields.Char(string="Infobip Whatsapp Number", + config_parameter='infobip_whatsapp_integration' + '.infobip_whatsapp', + help="Enter the Infobip WhatsApp number " + "for integration.") diff --git a/infobip_whatsapp_integration/models/res_partner.py b/infobip_whatsapp_integration/models/res_partner.py new file mode 100644 index 000000000..9188c745a --- /dev/null +++ b/infobip_whatsapp_integration/models/res_partner.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Jabin MP (odoo@cybrosys.com) +# +# 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 models + + +class ResPartner(models.Model): + """This class extends the 'res.partner' model to add the + 'action_open_whatsapp' method.It opens a WhatsApp Message Wizard for the + partner.""" + _inherit = 'res.partner' + + def action_open_whatsapp(self): + """This method opens a WhatsApp Message Wizard for the partner.""" + return { + 'type': 'ir.actions.act_window', + 'name': f'Send WhatsApp Message to {self.name}', + 'res_model': 'whatsapp.message', + 'view_mode': 'form', + 'view_id': self.env.ref( + 'infobip_whatsapp_integration.view_whatsapp_message_form').id, + 'target': 'new', + 'context': { + 'default_partner_name': self.name, + 'default_partner_mobile': self.mobile, + }, + } diff --git a/infobip_whatsapp_integration/security/ir.model.access.csv b/infobip_whatsapp_integration/security/ir.model.access.csv new file mode 100644 index 000000000..b0d3c2487 --- /dev/null +++ b/infobip_whatsapp_integration/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_whatsapp_message_user,access.whatsapp.message.user,model_whatsapp_message,base.group_user,1,1,1,1 diff --git a/infobip_whatsapp_integration/static/description/assets/icons/check.png b/infobip_whatsapp_integration/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/check.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/chevron.png b/infobip_whatsapp_integration/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/chevron.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/cogs.png b/infobip_whatsapp_integration/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/cogs.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/consultation.png b/infobip_whatsapp_integration/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/consultation.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/ecom-black.png b/infobip_whatsapp_integration/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/ecom-black.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/education-black.png b/infobip_whatsapp_integration/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/education-black.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/hotel-black.png b/infobip_whatsapp_integration/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/hotel-black.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/license.png b/infobip_whatsapp_integration/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/license.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/lifebuoy.png b/infobip_whatsapp_integration/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/lifebuoy.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/manufacturing-black.png b/infobip_whatsapp_integration/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/manufacturing-black.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/pos-black.png b/infobip_whatsapp_integration/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/pos-black.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/puzzle.png b/infobip_whatsapp_integration/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/puzzle.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/restaurant-black.png b/infobip_whatsapp_integration/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/restaurant-black.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/service-black.png b/infobip_whatsapp_integration/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/service-black.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/trading-black.png b/infobip_whatsapp_integration/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/trading-black.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/training.png b/infobip_whatsapp_integration/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/training.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/update.png b/infobip_whatsapp_integration/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/update.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/user.png b/infobip_whatsapp_integration/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/user.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/icons/wrench.png b/infobip_whatsapp_integration/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/icons/wrench.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/categories.png b/infobip_whatsapp_integration/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/categories.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/check-box.png b/infobip_whatsapp_integration/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/check-box.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/compass.png b/infobip_whatsapp_integration/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/compass.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/corporate.png b/infobip_whatsapp_integration/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/corporate.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/customer-support.png b/infobip_whatsapp_integration/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/customer-support.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/cybrosys-logo.png b/infobip_whatsapp_integration/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/cybrosys-logo.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/features.png b/infobip_whatsapp_integration/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/features.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/logo.png b/infobip_whatsapp_integration/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/logo.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/pictures.png b/infobip_whatsapp_integration/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/pictures.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/pie-chart.png b/infobip_whatsapp_integration/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/pie-chart.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/right-arrow.png b/infobip_whatsapp_integration/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/right-arrow.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/star.png b/infobip_whatsapp_integration/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/star.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/support.png b/infobip_whatsapp_integration/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/support.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/misc/whatsapp.png b/infobip_whatsapp_integration/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/misc/whatsapp.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/modules/11.png b/infobip_whatsapp_integration/static/description/assets/modules/11.png new file mode 100644 index 000000000..eb3f8652f Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/modules/11.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/modules/12.png b/infobip_whatsapp_integration/static/description/assets/modules/12.png new file mode 100644 index 000000000..3415917c2 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/modules/12.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/modules/13.png b/infobip_whatsapp_integration/static/description/assets/modules/13.png new file mode 100644 index 000000000..7a9d3b1f6 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/modules/13.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/modules/14.png b/infobip_whatsapp_integration/static/description/assets/modules/14.png new file mode 100644 index 000000000..c6a41b7ec Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/modules/14.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/modules/15.png b/infobip_whatsapp_integration/static/description/assets/modules/15.png new file mode 100644 index 000000000..33a2b2e25 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/modules/15.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/modules/16.png b/infobip_whatsapp_integration/static/description/assets/modules/16.png new file mode 100644 index 000000000..0d814d2db Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/modules/16.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/1.png b/infobip_whatsapp_integration/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..581980c62 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/1.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/10.png b/infobip_whatsapp_integration/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..2f4b742dc Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/10.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/11.png b/infobip_whatsapp_integration/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..422fb7000 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/11.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/12.png b/infobip_whatsapp_integration/static/description/assets/screenshots/12.png new file mode 100644 index 000000000..d98568177 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/12.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/13.png b/infobip_whatsapp_integration/static/description/assets/screenshots/13.png new file mode 100644 index 000000000..c6d934221 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/13.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/14.png b/infobip_whatsapp_integration/static/description/assets/screenshots/14.png new file mode 100644 index 000000000..3cb2a3d02 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/14.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/15.png b/infobip_whatsapp_integration/static/description/assets/screenshots/15.png new file mode 100644 index 000000000..6b4c557c0 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/15.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/16.png b/infobip_whatsapp_integration/static/description/assets/screenshots/16.png new file mode 100644 index 000000000..63e96dc68 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/16.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/17.png b/infobip_whatsapp_integration/static/description/assets/screenshots/17.png new file mode 100644 index 000000000..b15f200d1 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/17.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/2.png b/infobip_whatsapp_integration/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..72596a03b Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/2.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/3.png b/infobip_whatsapp_integration/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..6d6deae37 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/3.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/4.png b/infobip_whatsapp_integration/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..14f2ae1da Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/4.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/5.png b/infobip_whatsapp_integration/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..e03197c16 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/5.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/6.png b/infobip_whatsapp_integration/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..e5fc79519 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/6.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/7.png b/infobip_whatsapp_integration/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..e6a5db908 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/7.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/8.png b/infobip_whatsapp_integration/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..ae6330daf Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/8.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/9.png b/infobip_whatsapp_integration/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..2b8340891 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/9.png differ diff --git a/infobip_whatsapp_integration/static/description/assets/screenshots/hero.gif b/infobip_whatsapp_integration/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..38a3be759 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/assets/screenshots/hero.gif differ diff --git a/infobip_whatsapp_integration/static/description/banner.jpg b/infobip_whatsapp_integration/static/description/banner.jpg new file mode 100644 index 000000000..7aa372ac7 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/banner.jpg differ diff --git a/infobip_whatsapp_integration/static/description/icon.png b/infobip_whatsapp_integration/static/description/icon.png new file mode 100644 index 000000000..b73b3b360 Binary files /dev/null and b/infobip_whatsapp_integration/static/description/icon.png differ diff --git a/infobip_whatsapp_integration/static/description/index.html b/infobip_whatsapp_integration/static/description/index.html new file mode 100644 index 000000000..fcbe8df40 --- /dev/null +++ b/infobip_whatsapp_integration/static/description/index.html @@ -0,0 +1,809 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+

+ Infobip Whatsapp Integration

+

+ Send Different Types of Whatsapp Messages to Each Partner + Using Infobip Gateway

+ +
+
+ + + +
+
+

+ Overview +

+
+ +
+

+ This Module Helps you to Send a Whatsapp Message to your + Partners to send text message , send interactive list and + button message ,send contact details and to send location + of a user. +

+
+
+ +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Send Text Message Using Infobip

+
+
+ +
+
+ +
+
+

+ Send Interactive Button and List Message to + partner.

+
+
+ +
+
+ +
+
+

+ Send Contact Details of Users to Another Users.

+
+
+ +
+
+ +
+
+

+ Send Location Details of Users to Others

+
+
+
+
+ +
+
+

+ In Infobip We can See the Log Details of Sent + Messages.

+
+
+
+
+ +
+
+

+ Screenshots +

+
+
+

+ Infobip Credentials

+

+ Go to the Infobip website at https://portal.infobip.com/
+ Click on the "Sign Up" Button to Create a new Account. If you + already have an Account, you can Log In Instead.

+ +

+ After Logging in, Navigate to the Homepage. Where you can see + the API Key + and API Base URL . Below that we can see the Whatsapp . +

+ +

+ Below that we can see "Continue your journey with WhatsApp API + ".Complete the 5 steps below.

+ +

+ Its is important to connect with the whatsapp , by + scanning the qrcode or sending message directly from your + whatsapp

+ +

+ By clicking "VIEW LOG" , we can see the log details of sent + messages, Also Copy the "test sender" to use as infobip + Number

+
+ +
+

+ Configuration of Credentials

+

+ Go to Settings and add Infobip Account + Credentials.

+ +
+
+

+ Add whatsapp mobile number to any partner.We can see in header + "WHATSAPP" Button .Click on it.

+ +
+ +
+

+ A Wizard with alot of options to send whatsapp message will be + shown. +

+ +

+ Choose One Method to Send Message . Choose Text Message and + click the "Send Message" Button

+ +

+ The message shown as: +

+ +

+ Choose Interactive Button Message .

+ +

+ The message shown as: +

+ +

+ Choose Share Contact Details . +

+ +

+ The message shown as: +

+ +
+
+

+ Choose Interactive List Message .

+ +

+ The message shown as: +

+ +

+ The Options shown as: +

+ +
+ +
+

+ Choose Share Location .

+ +

+ The message shown as: + +

+ +
+ +
+ +
+
+ +
+

+ Related + Products +

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

+ Our Services +

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

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

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

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

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

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need + help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on + WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ +
\ No newline at end of file diff --git a/infobip_whatsapp_integration/views/res_config_settings_views.xml b/infobip_whatsapp_integration/views/res_config_settings_views.xml new file mode 100644 index 000000000..9589de109 --- /dev/null +++ b/infobip_whatsapp_integration/views/res_config_settings_views.xml @@ -0,0 +1,61 @@ + + + + + + res.config.settings.view.form.inherit.infobip.whatsapp.integration + + res.config.settings + + +
+

Infobip Credentials for Whatsapp

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/infobip_whatsapp_integration/views/res_partner_views.xml b/infobip_whatsapp_integration/views/res_partner_views.xml new file mode 100644 index 000000000..c1eebf3ef --- /dev/null +++ b/infobip_whatsapp_integration/views/res_partner_views.xml @@ -0,0 +1,25 @@ + + + + + + res.partner.view.form.inherit.infobip.whatsapp.integration + + res.partner + + + + +
+ +
+
+
+
+
diff --git a/infobip_whatsapp_integration/wizard/__init__.py b/infobip_whatsapp_integration/wizard/__init__.py new file mode 100644 index 000000000..6ee21df31 --- /dev/null +++ b/infobip_whatsapp_integration/wizard/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Jumana Jabin MP (odoo@cybrosys.com) +# +# 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 whatsapp_message diff --git a/infobip_whatsapp_integration/wizard/whatsapp_message.py b/infobip_whatsapp_integration/wizard/whatsapp_message.py new file mode 100644 index 000000000..3c1d829aa --- /dev/null +++ b/infobip_whatsapp_integration/wizard/whatsapp_message.py @@ -0,0 +1,290 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Jumana Jabin MP (odoo@cybrosys.com) +# +# 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 infobip_channels import WhatsAppChannel +from odoo import fields, models, _ +from odoo.exceptions import ValidationError + + +class WhatsAppMessage(models.TransientModel): + """WhatsApp Message Wizard Model This model is used to send various types + of WhatsApp messages.""" + _name = 'whatsapp.message' + _description = 'WhatsApp Message Wizard' + + message_type = fields.Selection([ + ('text', 'Text Message'), + ('button', 'Interactive Button Message'), + ('contact', 'Share Contact Details'), + ('list', 'Interactive List Message'), + ('location', 'Share Location'), + ], string='Message Type', default='text', + help="Choose a method to send Message") + text_message = fields.Char(string='Text Message', + help='Enter the text message content') + partner_name = fields.Char(string='Partner Name', + readonly=True, + store=True, help='Name of the partner') + partner_mobile = fields.Char(string='Partner Mobile', + readonly=True, + store=True, + help='Mobile number of the partner') + text = fields.Char(string="Type Header Text", help='Enter the header text') + yes_text = fields.Char(string="Text for Yes Reply", + help='Text for the "Yes" reply option') + no_text = fields.Char(string="Text for No Reply", + help='Text for the "No" reply option') + later_text = fields.Char(string="Text for Later Reply", + help='Text for the "Later" reply option') + partner_ids = fields.Many2many('res.partner', string='Select Partners', + help='Select one or more partners') + footer_text = fields.Char(string="Type Footer Text", + help='Enter the footer text') + section_title = fields.Char(string="Title of Section", + help='Title of the section') + section1_title = fields.Char(string="Type Option 1 Title", + help='Title for Option 1') + section1_description = fields.Char(string="Type Option 1 Description", + help='Description for Option 1') + section2_title = fields.Char(string="Type Option 2 Title", + help='Title for Option 2') + section2_description = fields.Char(string="Type Option 2 Description", + help='Description for Option 2') + section3_title = fields.Char(string="Type Option 3 Title", + help='Title for Option 3') + section3_description = fields.Char(string="Type Option 3 Description", + help='Description for Option 3') + section4_title = fields.Char(string="Type Option 4 Title", + help='Title for Option 4') + section4_description = fields.Char(string="Type Option 4 Description", + help='Description for Option 4') + + def _get_config_parameter(self, param_name): + """Retrieve a configuration parameter value from the database.""" + return self.env['ir.config_parameter'].sudo().get_param(param_name) + + def action_send_message(self): + """Send a Text Message through WhatsApp.""" + url = self._get_config_parameter( + 'infobip_whatsapp_integration.base_url') + api_key = self._get_config_parameter( + 'infobip_whatsapp_integration.api_key') + number = self._get_config_parameter( + 'infobip_whatsapp_integration.infobip_whatsapp') + if not all([url, api_key, number, self.text_message]): + raise ValidationError( + _('Incomplete Data: Please ensure you have provided all ' + 'necessary information to send the WhatsApp message.')) + channel = WhatsAppChannel.from_auth_params({ + "base_url": url, + "api_key": api_key, }) + response = channel.send_text_message({ + "from": number, + "to": self.partner_mobile, + "content": { + "text": self.text_message + }}) + return response + + def action_send_intractive_message(self): + """Send an Interactive Button Message through WhatsApp.""" + url = self._get_config_parameter( + 'infobip_whatsapp_integration.base_url') + api_key = self._get_config_parameter( + 'infobip_whatsapp_integration.api_key') + number = self._get_config_parameter( + 'infobip_whatsapp_integration.infobip_whatsapp') + if (self.text_message and self.partner_mobile and url and api_key and + number and self.yes_text and self.no_text and self.later_text + and self.text): + channel = WhatsAppChannel.from_auth_params({ + "base_url": url, + "api_key": api_key, }) + button_message = channel.send_interactive_buttons_message({ + "from": number, + "to": self.partner_mobile, + "content": { + "body": { + "text": self.text_message}, + "action": { + "buttons": [ + { + "type": "REPLY", + "id": "yes", + "title": self.yes_text + }, { + "type": "REPLY", + "id": "no", + "title": self.no_text + }, { + "type": "REPLY", + "id": "later", + "title": self.later_text + }, ]}, + "header": { + "type": "TEXT", + "text": self.text + }}}) + return button_message + else: + raise ValidationError( + _('Incomplete Data: Please ensure you have provided all' + ' necessary information to send the WhatsApp message.')) + + def action_send_contact_details(self): + """ Share Contact Details through WhatsApp.""" + url = self._get_config_parameter( + 'infobip_whatsapp_integration.base_url') + api_key = self._get_config_parameter( + 'infobip_whatsapp_integration.api_key') + number = self._get_config_parameter( + 'infobip_whatsapp_integration.infobip_whatsapp') + if (self.partner_ids and self.partner_mobile and url and api_key and + number): + channel = WhatsAppChannel.from_auth_params({ + "base_url": url, + "api_key": api_key, }) + contact_messages = [] + for partner in self.partner_ids: + contact = { + "addresses": [{ + "street": partner.street, + "city": partner.city, + "zip": partner.zip, + "country": partner.country_id.name, + "type": "HOME" + }], + "emails": [{ + "email": partner.email, + "type": "WORK" + }, ], + "name": { + "firstName": partner.name, + "formattedName": partner.name + }, + "phones": [{ + "phone": partner.phone, + "type": "HOME", + }, { + "phone": partner.mobile, + "type": "WORK", + }]} + contact_messages.append(contact) + for message in contact_messages: + response = channel.send_contact_message({ + "from": number, + "to": self.partner_mobile, + "content": { + "contacts": [message] + }}) + return response + else: + raise ValidationError( + _('Incomplete Data: Please ensure you have provided all' + ' necessary information to send the WhatsApp message.')) + + def action_send_interactive_list_message(self): + """Send an Interactive List Message through WhatsApp.""" + url = self._get_config_parameter( + 'infobip_whatsapp_integration.base_url') + api_key = self._get_config_parameter( + 'infobip_whatsapp_integration.api_key') + number = self._get_config_parameter( + 'infobip_whatsapp_integration.infobip_whatsapp') + if (self.text_message and self.partner_mobile and url and api_key and + number and self.text and self.footer_text and + self.section_title and self.section1_title and + self.section2_title and self.section3_title and + self.section4_title and self.section1_description and + self.section2_description and self.section3_description + and self.section4_description): + channel = WhatsAppChannel.from_auth_params({ + "base_url": url, + "api_key": api_key, }) + list_message = channel.send_interactive_list_message({ + "from": number, + "to": self.partner_mobile, + "content": { + "body": { + "text": self.text_message + }, + "action": { + "title": "See All Options", + "sections": [ + { + "title": self.section_title, + "rows": [{ + "id": "1", + "title": self.section1_title, + "description": self.section1_description + }, { + "id": "2", + "title": self.section2_title, + "description": self.section2_description + }, { + "id": "3", + "title": self.section3_title, + "description": self.section3_description + }, { + "id": "4", + "title": self.section4_title, + "description": self.section4_description + }]}]}, + "header": { + "type": "TEXT", + "text": self.text}, + "footer": { + "text": self.footer_text + }}}) + return list_message + else: + raise ValidationError( + _('Incomplete Data: Please ensure you have provided all' + ' necessary information to send the WhatsApp message.')) + + def action_send_location_details(self): + """Share Location Details through WhatsApp.""" + url = self._get_config_parameter( + 'infobip_whatsapp_integration.base_url') + api_key = self._get_config_parameter( + 'infobip_whatsapp_integration.api_key') + number = self._get_config_parameter( + 'infobip_whatsapp_integration.infobip_whatsapp') + if (self.partner_ids and self.partner_mobile and url and api_key and + number): + for partner in self.partner_ids: + channel = WhatsAppChannel.from_auth_params({ + "base_url": url, + "api_key": api_key, }) + response = channel.send_location_message({ + "from": number, + "to": self.partner_mobile, + "content": { + "latitude": partner.partner_latitude, + "longitude": partner.partner_longitude, + "name": partner.name, + "address": partner.street + }}) + return response + else: + raise ValidationError( + _('Incomplete Data: Please ensure you have provided all' + ' necessary information to send the WhatsApp message.')) diff --git a/infobip_whatsapp_integration/wizard/whatsapp_message_views.xml b/infobip_whatsapp_integration/wizard/whatsapp_message_views.xml new file mode 100644 index 000000000..20f98ae5d --- /dev/null +++ b/infobip_whatsapp_integration/wizard/whatsapp_message_views.xml @@ -0,0 +1,104 @@ + + + + + whatsapp.message.view.form + whatsapp.message + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +