diff --git a/survey_whatsapp_integration/README.rst b/survey_whatsapp_integration/README.rst new file mode 100755 index 000000000..5d4ffdcf8 --- /dev/null +++ b/survey_whatsapp_integration/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Survey Whatsapp Integration +=========================== +This module helps to share survey link to customers through whatsapp. + +Configuration +============= +* Enable whatsapp user in settings + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developers: (V16)Farhana Jahan PT, 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/survey_whatsapp_integration/__init__.py b/survey_whatsapp_integration/__init__.py new file mode 100755 index 000000000..e3e6addd9 --- /dev/null +++ b/survey_whatsapp_integration/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Farhana Jahan PT(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models +from . import wizard diff --git a/survey_whatsapp_integration/__manifest__.py b/survey_whatsapp_integration/__manifest__.py new file mode 100755 index 000000000..d91064604 --- /dev/null +++ b/survey_whatsapp_integration/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Farhana Jahan PT(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Survey Whatsapp Integration', + 'version': '16.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """Send survey link through whatsapp.""", + 'description': 'This module allows users to send link and' + ' other details about survey through whatsapp.', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['survey'], + 'data': ['security/survey_whatsapp_integration_groups.xml', + 'security/ir.model.access.csv', + 'views/survey_survey_views.xml', + 'views/configuration_manager_views.xml', + 'views/whatsapp_message_views.xml', + 'views/survey_whatsapp_integration_menu.xml', + 'wizard/survey_whatsapp_views.xml', + 'wizard/whatsapp_authenticate_views.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/survey_whatsapp_integration/doc/RELEASE_NOTES.md b/survey_whatsapp_integration/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..ad97ca555 --- /dev/null +++ b/survey_whatsapp_integration/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module +#### 02.12.2023 +#### Version 16.0.1.0.0 +##### ADD +- Initial commit for Survey Whatsapp Integration diff --git a/survey_whatsapp_integration/models/__init__.py b/survey_whatsapp_integration/models/__init__.py new file mode 100755 index 000000000..17bec245c --- /dev/null +++ b/survey_whatsapp_integration/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Farhana Jahan PT(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import configuration_manager +from . import survey_survey +from . import whatsapp_message diff --git a/survey_whatsapp_integration/models/configuration_manager.py b/survey_whatsapp_integration/models/configuration_manager.py new file mode 100755 index 000000000..1cb3305a9 --- /dev/null +++ b/survey_whatsapp_integration/models/configuration_manager.py @@ -0,0 +1,90 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Farhana Jahan PT(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +import requests +from odoo import fields, models, _ +from odoo.exceptions import ValidationError + + +class ConfigurationManager(models.Model): + """Create new model""" + _name = "configuration.manager" + _description = "Configuration Manager" + _rec_name = 'instance' + + instance = fields.Char(string="Instance", required=True, + help="Give instance for whatsapp api") + token = fields.Char(string="Token", required=True, + help="Give token for whatsapp api") + state = fields.Selection( + selection=[('draft', 'Draft'), + ('verified', 'Verified')], + default='draft', string="state", + help="State for connection") + + def action_authenticate(self): + """ Opens a wizard for scanning QR code, + After scanning number get active status.""" + url = "https://api.apichat.io/v1/status" + headers = { + "client-id": self.instance, + "token": self.token + } + req = requests.get(url, headers=headers, timeout=10) + if req.status_code != 200: + raise ValidationError(_("Please provide valid token")) + if req.text == 'Client not found.': + return self.display_notification('danger', + 'Please check the field values') + if 'qr' in req.json().keys(): + self.state = "draft" + new_data = req.json()['qr'].replace('data:image/png;base64,', '') + return self.open_authenticate_wizard(new_data) + if req.json()['is_connected']: + self.state = "verified" + return self.display_notification('success', + 'Already connected') + + def display_notification(self, message_type, message): + """ Got connected message""" + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'message': message, + 'type': message_type, + 'sticky': False, + } + } + + def open_authenticate_wizard(self, qrcode): + """Opens QR code scanning wizard""" + return { + 'type': 'ir.actions.act_window', + 'res_model': 'whatsapp.authenticate', + 'name': 'WhatsApp Connect', + 'views': [(False, 'form')], + 'target': 'new', + 'context': { + 'default_qrcode': qrcode, + 'default_config_manager_id': self.id, + } + } diff --git a/survey_whatsapp_integration/models/survey_survey.py b/survey_whatsapp_integration/models/survey_survey.py new file mode 100755 index 000000000..32ab8f4a9 --- /dev/null +++ b/survey_whatsapp_integration/models/survey_survey.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Farhana Jahan PT(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 models + + +class SurveySurvey(models.Model): + """ Inherit survey,so we are adding a + wizard for sending whatsapp. """ + _inherit = 'survey.survey' + + def action_whatsapp_send(self): + """Opens a wizard for whatsapp share""" + return { + 'name': "Whatsapp Share", + 'type': 'ir.actions.act_window', + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'survey.whatsapp', + 'view_id': self.env.ref( + 'survey_whatsapp_integration.survey_whatsapp_view_form').id, + 'target': 'new', + 'context': {'default_survey_id': self.id} + } diff --git a/survey_whatsapp_integration/models/whatsapp_message.py b/survey_whatsapp_integration/models/whatsapp_message.py new file mode 100755 index 000000000..22745f598 --- /dev/null +++ b/survey_whatsapp_integration/models/whatsapp_message.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Farhana Jahan PT(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 WhatsappMessage(models.Model): + """Create new model""" + _name = "whatsapp.message" + _description = "Whatsapp Message" + _rec_name = 'to_user' + + status = fields.Char(string="Status", + help="status of whatsapp messages") + from_user = fields.Many2one('res.users', string="Sent From", + help="from user in whatsapp messages", + required=True) + to_user = fields.Char(string="Sent to", + help="to user in whatsapp messages", required=True) + body = fields.Char(string="Message", + help="Message body in whatsapp messages", required=True) diff --git a/survey_whatsapp_integration/security/ir.model.access.csv b/survey_whatsapp_integration/security/ir.model.access.csv new file mode 100755 index 000000000..2cc5f6e80 --- /dev/null +++ b/survey_whatsapp_integration/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_survey_whatsapp,access.survey.whatsapp,model_survey_whatsapp,base.group_user,1,1,1,1 +access_configuration_manager_whatsapp_user,access.configuration.manager.whatsapp.user,model_configuration_manager,survey_whatsapp_integration.survey_whatsapp_integration_group_user,1,1,1,1 +access_whatsapp_authenticate_whatsapp_user,access.whatsapp.authenticate.whatsapp.user,model_whatsapp_authenticate,survey_whatsapp_integration.survey_whatsapp_integration_group_user,1,1,1,1 +access_whatsapp_message_whatsapp_user,access.whatsapp.message.whatsapp.user,model_whatsapp_message,survey_whatsapp_integration.survey_whatsapp_integration_group_user,1,1,1,1 diff --git a/survey_whatsapp_integration/security/survey_whatsapp_integration_groups.xml b/survey_whatsapp_integration/security/survey_whatsapp_integration_groups.xml new file mode 100755 index 000000000..3630ed9cc --- /dev/null +++ b/survey_whatsapp_integration/security/survey_whatsapp_integration_groups.xml @@ -0,0 +1,9 @@ + + + + + + Whatsapp Messaging + + + diff --git a/survey_whatsapp_integration/static/description/assets/icons/chevron.png b/survey_whatsapp_integration/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/chevron.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/cogs.png b/survey_whatsapp_integration/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/cogs.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/consultation.png b/survey_whatsapp_integration/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/consultation.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/ecom-black.png b/survey_whatsapp_integration/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/ecom-black.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/education-black.png b/survey_whatsapp_integration/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/education-black.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/hotel-black.png b/survey_whatsapp_integration/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/hotel-black.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/license.png b/survey_whatsapp_integration/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/license.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/lifebuoy.png b/survey_whatsapp_integration/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/lifebuoy.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/manufacturing-black.png b/survey_whatsapp_integration/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/manufacturing-black.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/pos-black.png b/survey_whatsapp_integration/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/pos-black.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/puzzle.png b/survey_whatsapp_integration/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/puzzle.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/restaurant-black.png b/survey_whatsapp_integration/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/restaurant-black.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/service-black.png b/survey_whatsapp_integration/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/service-black.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/trading-black.png b/survey_whatsapp_integration/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/trading-black.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/training.png b/survey_whatsapp_integration/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/training.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/update.png b/survey_whatsapp_integration/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/update.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/user.png b/survey_whatsapp_integration/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/user.png differ diff --git a/survey_whatsapp_integration/static/description/assets/icons/wrench.png b/survey_whatsapp_integration/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/icons/wrench.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/categories.png b/survey_whatsapp_integration/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/categories.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/check-box.png b/survey_whatsapp_integration/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/check-box.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/compass.png b/survey_whatsapp_integration/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/compass.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/corporate.png b/survey_whatsapp_integration/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/corporate.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/customer-support.png b/survey_whatsapp_integration/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/customer-support.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/cybrosys-logo.png b/survey_whatsapp_integration/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/cybrosys-logo.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/features.png b/survey_whatsapp_integration/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/features.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/logo.png b/survey_whatsapp_integration/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/logo.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/pictures.png b/survey_whatsapp_integration/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/pictures.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/pie-chart.png b/survey_whatsapp_integration/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/pie-chart.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/right-arrow.png b/survey_whatsapp_integration/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/right-arrow.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/star.png b/survey_whatsapp_integration/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/star.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/support.png b/survey_whatsapp_integration/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/support.png differ diff --git a/survey_whatsapp_integration/static/description/assets/misc/whatsapp.png b/survey_whatsapp_integration/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/misc/whatsapp.png differ diff --git a/survey_whatsapp_integration/static/description/assets/modules/1.png b/survey_whatsapp_integration/static/description/assets/modules/1.png new file mode 100755 index 000000000..3415917c2 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/modules/1.png differ diff --git a/survey_whatsapp_integration/static/description/assets/modules/2.png b/survey_whatsapp_integration/static/description/assets/modules/2.png new file mode 100644 index 000000000..c50f2b1a8 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/modules/2.png differ diff --git a/survey_whatsapp_integration/static/description/assets/modules/3.png b/survey_whatsapp_integration/static/description/assets/modules/3.png new file mode 100644 index 000000000..eb3f8652f Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/modules/3.png differ diff --git a/survey_whatsapp_integration/static/description/assets/modules/4.png b/survey_whatsapp_integration/static/description/assets/modules/4.png new file mode 100644 index 000000000..33a2b2e25 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/modules/4.png differ diff --git a/survey_whatsapp_integration/static/description/assets/modules/5.png b/survey_whatsapp_integration/static/description/assets/modules/5.png new file mode 100644 index 000000000..c6a41b7ec Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/modules/5.png differ diff --git a/survey_whatsapp_integration/static/description/assets/modules/6.png b/survey_whatsapp_integration/static/description/assets/modules/6.png new file mode 100644 index 000000000..cca5c5845 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/modules/6.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/hero.gif b/survey_whatsapp_integration/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..65b9d3a6a Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/hero.gif differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_-1.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_-1.png new file mode 100755 index 000000000..29b9ceca1 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_-1.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_0.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_0.png new file mode 100755 index 000000000..0e0f24e0e Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_0.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_1.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_1.png new file mode 100755 index 000000000..a0fbe7c8a Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_1.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_10.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_10.png new file mode 100755 index 000000000..a2664e78c Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_10.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_2.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_2.png new file mode 100755 index 000000000..035da00f3 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_2.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_3.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_3.png new file mode 100755 index 000000000..71f90f061 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_3.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_4.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_4.png new file mode 100755 index 000000000..9d85c5f93 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_4.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_5.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_5.png new file mode 100755 index 000000000..3e8d7fed9 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_5.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_6.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_6.png new file mode 100755 index 000000000..636c8256e Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_6.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_7.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_7.png new file mode 100755 index 000000000..f2444ec45 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_7.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_8.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_8.png new file mode 100755 index 000000000..650aa9829 Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_8.png differ diff --git a/survey_whatsapp_integration/static/description/assets/screenshots/wp_9.png b/survey_whatsapp_integration/static/description/assets/screenshots/wp_9.png new file mode 100755 index 000000000..9dabc3efd Binary files /dev/null and b/survey_whatsapp_integration/static/description/assets/screenshots/wp_9.png differ diff --git a/survey_whatsapp_integration/static/description/banner.jpg b/survey_whatsapp_integration/static/description/banner.jpg new file mode 100755 index 000000000..803c149ed Binary files /dev/null and b/survey_whatsapp_integration/static/description/banner.jpg differ diff --git a/survey_whatsapp_integration/static/description/icon.png b/survey_whatsapp_integration/static/description/icon.png new file mode 100755 index 000000000..c6712b955 Binary files /dev/null and b/survey_whatsapp_integration/static/description/icon.png differ diff --git a/survey_whatsapp_integration/static/description/index.html b/survey_whatsapp_integration/static/description/index.html new file mode 100755 index 000000000..9a5134ddb --- /dev/null +++ b/survey_whatsapp_integration/static/description/index.html @@ -0,0 +1,588 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+ +

+ Survey Whatsapp Integration

+

+ This module helps to share survey link to customers through whatsapp.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This module helps to share survey link to customers by clicking whatsapp button in survey module.
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + Community and Enterprise Support +
+
+ + + Share survey link to multiple customers + +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

+ Create an account in https://panel.apichat.io/app/accounts.Then take token and instance. + +

+ +
+ +
+

+ Enable Whatsapp User in settings. + +

+ +
+ +
+

+ Choose whatsapp configuration. + +

+ +
+ +
+

+ Create a new whatsapp QR code for login by giving instance and token. + +

+ +
+ +
+

+ After scanning QR code from mobile save it. + +

+ +
+ +
+

+ In survey module click on whatsapp button. + +

+ +
+ +
+

+ After giving recipients and deadline click on send button. + +

+ +
+ +
+

+ In whatsapp can see the messages send to recipients. + +

+ +
+ +
+

+ You can see all messages sent through WhatsApp in the WhatsApp menu. + +

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

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

+
+
+
+
+
+
+
+ +
+
+
diff --git a/survey_whatsapp_integration/views/configuration_manager_views.xml b/survey_whatsapp_integration/views/configuration_manager_views.xml new file mode 100755 index 000000000..3d50a8327 --- /dev/null +++ b/survey_whatsapp_integration/views/configuration_manager_views.xml @@ -0,0 +1,39 @@ + + + + + configuration.manager.view.tree + configuration.manager + + + + + + + + + + configuration.manager.view.form + configuration.manager + +
+ + + + + + + + + +
+
diff --git a/survey_whatsapp_integration/views/survey_whatsapp_integration_menu.xml b/survey_whatsapp_integration/views/survey_whatsapp_integration_menu.xml new file mode 100755 index 000000000..d425709c7 --- /dev/null +++ b/survey_whatsapp_integration/views/survey_whatsapp_integration_menu.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/survey_whatsapp_integration/views/whatsapp_message_views.xml b/survey_whatsapp_integration/views/whatsapp_message_views.xml new file mode 100755 index 000000000..3b20140ee --- /dev/null +++ b/survey_whatsapp_integration/views/whatsapp_message_views.xml @@ -0,0 +1,22 @@ + + + + + Whatsapp Message + whatsapp.message + tree + + + + whatsapp.message.view.list + whatsapp.message + + + + + + + + + + diff --git a/survey_whatsapp_integration/wizard/__init__.py b/survey_whatsapp_integration/wizard/__init__.py new file mode 100755 index 000000000..ff79c323d --- /dev/null +++ b/survey_whatsapp_integration/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Farhana Jahan PT(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import survey_whatsapp +from . import whatsapp_authenticate diff --git a/survey_whatsapp_integration/wizard/survey_whatsapp.py b/survey_whatsapp_integration/wizard/survey_whatsapp.py new file mode 100755 index 000000000..e53d62c6a --- /dev/null +++ b/survey_whatsapp_integration/wizard/survey_whatsapp.py @@ -0,0 +1,93 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Farhana Jahan PT(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +import requests +from requests.exceptions import RequestException +import werkzeug +from odoo import api, fields, models + + +class SurveyWhatsapp(models.TransientModel): + """ Share content to multiple whatsapp number.""" + _name = 'survey.whatsapp' + _description = "Survey Whatsapp" + + partner_ids = fields.Many2many('res.partner', + string="Recipient", + required=True, + help="Recipients for whatsapp message") + message = fields.Text(string="Message", + default="Dear Participants..We are conducting a" + "survey and your respond would be" + "appreciable.Please answer the following" + "survey", + required=True, + help="Message body for whatsapp message") + survey_start_url = fields.Char('Survey URL', + compute='_compute_survey_start_url', + required=True, + help="Url for starting survey") + answer_dead_line = fields.Date(string="Answer Dead Line", + required=True, + help="Deadline for getting answer") + survey_id = fields.Many2one('survey.survey', + string='Survey', + required=True, + help="Survey name") + + @api.depends('survey_id') + def _compute_survey_start_url(self): + """Automatically fill url of survey""" + for invite in self: + invite.survey_start_url = werkzeug.urls.url_join( + invite.survey_id.get_base_url(), + invite.survey_id.get_start_url()) if invite.survey_id else False + + def action_send_msg(self): + """Send content to whatsapp number.""" + for partner in self.partner_ids: + if self.message and partner.mobile: + instant = self.env['configuration.manager'].search( + [('state', '=', 'verified')], limit=1) + if instant: + url = "https://api.apichat.io/instance" + instant.instance + "/sendMessage?token=" + instant.token + sent_message = self.message + " " + self.survey_start_url + " " + 'before' + " " + str( + self.answer_dead_line) + data = { + "phone": int( + partner.mobile.replace('-', '').replace('(', + "").replace( + ')', '').replace(' ', '')), + "body": sent_message + } + try: + response = requests.post(url, json=data, timeout=30) + response.raise_for_status() + except RequestException as e: + return {'status': 'error', 'message': str(e)} + + else: + self.env['whatsapp.message'].create({ + 'status': 'sent', + 'from_user': self.env.user.id, + 'to_user': partner.mobile, + 'body': sent_message + }) diff --git a/survey_whatsapp_integration/wizard/survey_whatsapp_views.xml b/survey_whatsapp_integration/wizard/survey_whatsapp_views.xml new file mode 100755 index 000000000..076861ace --- /dev/null +++ b/survey_whatsapp_integration/wizard/survey_whatsapp_views.xml @@ -0,0 +1,26 @@ + + + + + survey.whatsapp.view.form + survey.whatsapp + +
+ + + + + + + + + +
+
+
+
+
+
diff --git a/survey_whatsapp_integration/wizard/whatsapp_authenticate.py b/survey_whatsapp_integration/wizard/whatsapp_authenticate.py new file mode 100755 index 000000000..a7a3d75e0 --- /dev/null +++ b/survey_whatsapp_integration/wizard/whatsapp_authenticate.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Farhana Jahan PT(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +import requests +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError + + +class WhatsappAuthenticate(models.TransientModel): + """Create a new model""" + _name = 'whatsapp.authenticate' + _description = 'Whatsapp Authentication Wizard' + + qrcode = fields.Binary(attachment=False, string="Qr Code", + help="QR code for scanning") + configuration_manager_id = fields.Many2one("configuration.manager", + string="Configuration Manager", + help="configuration manager" + "details") + + @api.constrains('config_manager_id') + def _check_active(self): + """check the scanned number is active or not.""" + url = "https://api.apichat.io/v1/status" + headers = { + "client-id": self.configuration_manager_id.instance, + "token": self.configuration_manager_id.token + } + req = requests.get(url, headers=headers, timeout=10) + if 'is_connected' in req.json().keys(): + if req.json()['is_connected']: + self.configuration_manager_id.state = "verified" + else: + raise ValidationError( + _("Please scan and connect your whatsapp web")) + if self.configuration_manager_id.state != "verified": + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'message': 'Check The Connection', + 'type': 'danger', + 'sticky': False, + } + } diff --git a/survey_whatsapp_integration/wizard/whatsapp_authenticate_views.xml b/survey_whatsapp_integration/wizard/whatsapp_authenticate_views.xml new file mode 100755 index 000000000..19538e299 --- /dev/null +++ b/survey_whatsapp_integration/wizard/whatsapp_authenticate_views.xml @@ -0,0 +1,20 @@ + + + + + whatsapp.authenticate.view.form + whatsapp.authenticate + +
+ + + + + + + +
+
+
+