diff --git a/all_in_one_whatsapp_integration/README.rst b/all_in_one_whatsapp_integration/README.rst new file mode 100644 index 000000000..79bdacb93 --- /dev/null +++ b/all_in_one_whatsapp_integration/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +All in one WhatsApp Integration Odoo16 +====================================== +This module helps you to send a whatsapp message to your partners that are in sale order, +purchase order, invoice and bills, and deliver orders. + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- pip install twilio + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +Affero General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +Developer: (V16)- Raneesha M K, Jumana Jabin MP, Vishnu P +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/all_in_one_whatsapp_integration/__init__.py b/all_in_one_whatsapp_integration/__init__.py new file mode 100644 index 000000000..be204b38e --- /dev/null +++ b/all_in_one_whatsapp_integration/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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 controllers +from . import models +from . import wizard diff --git a/all_in_one_whatsapp_integration/__manifest__.py b/all_in_one_whatsapp_integration/__manifest__.py new file mode 100644 index 000000000..148f249c1 --- /dev/null +++ b/all_in_one_whatsapp_integration/__manifest__.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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': "All in one WhatsApp Integration Odoo16", + 'version': '16.0.1.0.0', + 'category': 'Extra Tools', + 'summary': """WhatsApp Integration In Sale Order, Purchase Order, Delivery Order with Twilio and CloudAPI""", + 'description': """WhatsApp, WhatsApp Odoo, whatsapp, WhatsApp Integration In Sale Order, Purchase Order, Delivery Order with Twilio and CloudAPI""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'web', 'sale', 'stock', 'purchase', 'account', + 'contacts', 'website_livechat'], + 'data': [ + 'security/ir.model.access.csv', + 'data/account_move_data.xml', + 'data/purchase_order_data.xml', + 'data/sale_order_data.xml', + 'data/stock_picking_data.xml', + 'views/sale_order_views.xml', + 'views/purchase_order_views.xml', + 'views/stock_picking_views.xml', + 'views/account_move_views.xml', + 'views/mail_template_views.xml', + 'views/res_config_settings_views.xml', + 'views/mail_channel_views.xml', + 'wizard/send_whatsapp_message_views.xml', + ], + 'external_dependencies': { + 'python': ['twilio'], + }, + 'images': ['static/description/banner.png'], + 'license': "AGPL-3", + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/all_in_one_whatsapp_integration/controllers/__init__.py b/all_in_one_whatsapp_integration/controllers/__init__.py new file mode 100644 index 000000000..7bc8efaf6 --- /dev/null +++ b/all_in_one_whatsapp_integration/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# along with this program. If not, see . +# +############################################################################### +from . import all_in_one_whatsapp_integration diff --git a/all_in_one_whatsapp_integration/controllers/all_in_one_whatsapp_integration.py b/all_in_one_whatsapp_integration/controllers/all_in_one_whatsapp_integration.py new file mode 100644 index 000000000..1294df7ce --- /dev/null +++ b/all_in_one_whatsapp_integration/controllers/all_in_one_whatsapp_integration.py @@ -0,0 +1,92 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# along with this program. If not, see . +# +############################################################################### +from odoo import Command, http +from odoo.http import request + + +class Webhook(http.Controller): + """ Cloud api webhook controller """ + + @http.route('/whatsapp_message', type='http', auth='public', + methods=['GET', 'POST'], + csrf=False) + def get_webhook_url(self, **kwargs, ): + """ function create portal user and send message to live chat""" + if kwargs: + return (kwargs['hub.challenge']) + else: + active_user = request.env['res.users'].browse(request.uid) + data = request.get_json_data() + number = data['entry'][0]['changes'][0]['value'] + if number['contacts']: + profile = number['contacts'][0] + channel_partner_ids = [] + channel_partner_ids.append(active_user.partner_id.id) + to_partner = request.env['res.partner'].sudo().search([ + ('phone', '=', str(number['metadata']['display_phone_number'])) + ]) + if to_partner: + channel_partner_ids.append(to_partner.id) + contact = request.env['res.partner'].sudo().search([ + ('name', '=', profile['profile']['name']), + ('phone', '=', profile['wa_id']) + ]) + if contact: + channel_partner_ids.append(contact.id) + else: + contact = request.env['res.users'].sudo().create({ + 'name': profile['profile']['name'], + 'company_id': active_user.company_id.id, + 'login': profile['profile']['name'], + 'groups_id': [ + Command.set( + [request.env.ref('base.group_portal').id])], + }).partner_id + contact.phone = profile['wa_id'] + channel_partner_ids.append(contact.id) + message_content = \ + data['entry'][0]['changes'][0]['value']['messages'][0] + channel = request.env['mail.channel'].sudo().search([ + ('phone', '=', profile['wa_id']), + ('channel_partner_ids', 'in', channel_partner_ids) + ]) + if not channel: + channel = request.env['mail.channel'].sudo().create({ + 'channel_partner_ids': [(4, contact.id), + (4, to_partner.id)], + 'channel_type': 'livechat', + 'name': profile['profile']['name'], + 'phone': profile['wa_id'], + 'livechat_operator_id': "3" + }) + uuid = channel.uuid + mail_channel = request.env["mail.channel"].sudo().search( + [('uuid', '=', uuid)], limit=1) + body = message_content['text']['body'] + x = mail_channel.with_context( + mail_create_nosubscribe=True).message_post( + author_id=contact.id, + body=body, + message_type='comment', + subtype_xmlid='mail.mt_comment' + ) diff --git a/all_in_one_whatsapp_integration/data/account_move_data.xml b/all_in_one_whatsapp_integration/data/account_move_data.xml new file mode 100644 index 000000000..d08bd2815 --- /dev/null +++ b/all_in_one_whatsapp_integration/data/account_move_data.xml @@ -0,0 +1,46 @@ + + + + + + Whatsapp Template for Invoice + Invoice Template + + True + + +

+

+ Hello ** + Greetings from ** +
+
+ Your invoice number ** with amount ** + from . +
+
+ + This invoice is already paid and Amount due is ** + + + Please remit payment at your earliest convenience. Amount due is ** + +
+ The invoice date is +
+ Your order details are as follows: +
+ + + *Product: *
+ *Qty: *
+ *Price:*
+
+
+
+ If you have any questions, please feel free to contact us. + ]]> +
+
+
+
diff --git a/all_in_one_whatsapp_integration/data/purchase_order_data.xml b/all_in_one_whatsapp_integration/data/purchase_order_data.xml new file mode 100644 index 000000000..60f11c565 --- /dev/null +++ b/all_in_one_whatsapp_integration/data/purchase_order_data.xml @@ -0,0 +1,58 @@ + + + + + + Whatsapp Template for Purchase Order + Purchase Order Template + + True + + +

+

+ Hello **, + Greetings from ** +
+ + Your Request For Quotation (RFQ) ** with amount ** is ready. +
+ As per the planned date for receipt of products on +
+
+ Quotation details are mentioned below:
+ + + *Product: *
+ *Qty: *
+ *Price:*
+
+
+
+
+ +
+ Your Purchase Order Number ** with amount ** is Confirmed. +
+
+ As per you RFQ Order confirmation date and time is +
+
+ Order details are mentioned below:
+ + + *Product: *
+ *Qty: *
+ *Price:*
+
+
+
+
+
+ If you require any further information, feel free to contact me. +
+ ]]> +
+
+
+
diff --git a/all_in_one_whatsapp_integration/data/sale_order_data.xml b/all_in_one_whatsapp_integration/data/sale_order_data.xml new file mode 100644 index 000000000..be43f9cbc --- /dev/null +++ b/all_in_one_whatsapp_integration/data/sale_order_data.xml @@ -0,0 +1,56 @@ + + + + + + Whatsapp Template for Sale Order + Sales Order Template + + True + +
+ Hello **,
+ Greetings from ** +
+ + Your Sale Order Quotation ** with amount ** is ready. +
+ As per your quotation the date and time of the order is "" +
+
+ Quotation details are mentioned below:
+ + + *Product: *
+ *Quantity: *
+ *Price:*
+
+
+
+
+ +
+ Your Sale Order Number ** with amount ** is Confirmed. +
+
+ As per your quotation your order date and time of the order is "" +
+
+ Your order details are mentioned below:
+ + + *Product: *
+ *Quantity: *
+ *Price:*
+
+
+
+
+ If you require any further information, feel free to contact me. +
+
+ ]]> +
+
+
+
diff --git a/all_in_one_whatsapp_integration/data/stock_picking_data.xml b/all_in_one_whatsapp_integration/data/stock_picking_data.xml new file mode 100644 index 000000000..0344ac69e --- /dev/null +++ b/all_in_one_whatsapp_integration/data/stock_picking_data.xml @@ -0,0 +1,73 @@ + + + + + + Whatsapp Template for Delivery + Inventory Template + + True + +

+

+ Hello **, +
+
+ + We have received your order **. It will be shipped soon +
+ Order details are as follows:
+ + + *Product: *
+ *Qty: *
+
+
+
+
+ + Your order ** is ready. It will be shipped soon +
+ Order details are as follows:
+ + + *Product: *
+ *Qty: *
+
+
+
+
+ + Your order ** is ready. It will be shipped soon +
+ Order details are as follows:
+ + + *Product: *
+ *Qty: *
+
+
+
+
+ + Your order ** is shipped. +
+ Order details are as follows:
+ + + *Product: *
+ *Qty: *
+
+
+
+
+
+
+ If you have any questions, please feel free to contact us. +
+

+ ]]> +
+
+
+
diff --git a/all_in_one_whatsapp_integration/doc/RELEASE_NOTES.md b/all_in_one_whatsapp_integration/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..60560366e --- /dev/null +++ b/all_in_one_whatsapp_integration/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 26.10.2023 +#### Version 16.0.1.0.0 +#### ADD + - Initial Commit for All in one Whatsapp diff --git a/all_in_one_whatsapp_integration/models/__init__.py b/all_in_one_whatsapp_integration/models/__init__.py new file mode 100644 index 000000000..759df6702 --- /dev/null +++ b/all_in_one_whatsapp_integration/models/__init__.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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 account_move +from . import mail_channel +from . import mail_message +from . import mail_template +from . import purchase_order +from . import res_config_settings +from . import sale_order +from . import stock_picking diff --git a/all_in_one_whatsapp_integration/models/account_move.py b/all_in_one_whatsapp_integration/models/account_move.py new file mode 100644 index 000000000..e3b5e1c82 --- /dev/null +++ b/all_in_one_whatsapp_integration/models/account_move.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# along with this program. If not, see . +# +############################################################################### +import base64 +import html2text +from odoo import models, _ +from odoo.exceptions import ValidationError + + +class AccountMove(models.Model): + """Inherited the module for adding a button that helps to send WhatsApp + message to the customer. """ + _inherit = 'account.move' + + def action_send_by_whatsapp(self): + """ + This method is invoked when the 'send_by_whatsapp' button is clicked. + It opens a wizard containing the message to be sent to the WhatsApp + web page. """ + if not self.partner_id.mobile: + raise ValidationError( + _('Add a WhatsApp mobile number to the sale order partner!')) + if not self.partner_id.mobile.startswith('+'): + raise ValidationError( + _('Please add a valid mobile number along with a valid' + ' country code!')) + twilio_whatsapp = self.env['ir.config_parameter'].sudo().get_param( + 'all_in_one_whatsapp_integration.twilio_whatsapp') + if not twilio_whatsapp.startswith('+'): + raise ValidationError( + _('Please add a valid Twilio mobile number along with "+".')) + template_id = self.env.ref( + 'all_in_one_whatsapp_integration.account_move_whatsapp_template').id + mail_template = self.env['mail.template'].browse(template_id) + mail_template_values = mail_template.with_context( + tpl_partners_only=True).generate_email( + [self.id], fields=['body_html']) + body_html = mail_template_values[self.id].pop('body_html', '') + whatsapp_message = html2text.html2text(body_html) + report = self.env['ir.actions.report']._render_qweb_pdf( + 'account.account_invoices', self.id) + report_attachment = self.env['ir.attachment'].sudo().create({ + 'name': 'Invoice Report', + 'type': 'binary', + 'datas': base64.b64encode(report[0]), + 'store_fname': 'Invoice Report.pdf', + 'mimetype': 'application/pdf', + 'res_model': 'account.move', + }) + return { + 'type': 'ir.actions.act_window', + 'name': _('WhatsApp Message'), + 'res_model': 'send.whatsapp.message', + 'target': 'new', + 'view_mode': 'form', + 'view_type': 'form', + 'context': {'default_whatsapp_message': whatsapp_message, + 'default_attachment_ids': [(4, report_attachment.id)]}, + } diff --git a/all_in_one_whatsapp_integration/models/mail_channel.py b/all_in_one_whatsapp_integration/models/mail_channel.py new file mode 100644 index 000000000..246367c49 --- /dev/null +++ b/all_in_one_whatsapp_integration/models/mail_channel.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# along with this program. If not, see . +# +############################################################################### +from odoo import fields, models + + +class MailChannel(models.Model): + """This class extends the base 'mail.channel' model in Odoo to include a + 'phone' field for storing the phone number associated with the + communication channel.""" + _inherit = 'mail.channel' + + phone = fields.Char(string='Phone', help='Phone') diff --git a/all_in_one_whatsapp_integration/models/mail_message.py b/all_in_one_whatsapp_integration/models/mail_message.py new file mode 100644 index 000000000..c401de905 --- /dev/null +++ b/all_in_one_whatsapp_integration/models/mail_message.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : odoo@cybrosys.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# along with this program. If not, see . +# +############################################################################### +import http.client +import json +from odoo import api, models + + +class MailMessage(models.Model): + """This class extends the base 'mail.message' model in Odoo to include + functionality for sending WhatsApp messages using Facebook Graph API. + """ + _inherit = 'mail.message' + + @api.model_create_multi + def create(self, values_list): + """This method creates a new mail message and then sends the message's + body as a WhatsApp message using the Facebook Graph API.""" + bearer_token = self.env['ir.config_parameter'].sudo().get_param( + 'all_in_one_whatsapp_integration.bearer_token') + whatsapp_no = self.env['ir.config_parameter'].sudo().get_param( + 'all_in_one_whatsapp_integration.whatsapp_no') + if bearer_token and whatsapp_no and values_list[0]['model'] == 'mail.channel': + if values_list[0]['email_from']: + mail_channel = self.env['mail.channel'].browse( + values_list[0]['res_id']) + if mail_channel: + conn = http.client.HTTPSConnection("graph.facebook.com") + payload = json.dumps({ + "messaging_product": "whatsapp", + "recipient_type": "individual", + "to": mail_channel.phone, + "type": 'text', + "text": { + "preview_url": False, + "body": values_list[0]['body'] + } + }) + headers = { + 'Content-Type': 'application/json', + 'Authorization': f'Bearer {bearer_token}' + } + conn.request("POST", f"/v17.0/{whatsapp_no}/messages", + payload, + headers) + response = conn.getresponse() + return super(MailMessage, self).create(values_list) diff --git a/all_in_one_whatsapp_integration/models/mail_template.py b/all_in_one_whatsapp_integration/models/mail_template.py new file mode 100644 index 000000000..98c32b3b6 --- /dev/null +++ b/all_in_one_whatsapp_integration/models/mail_template.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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 MailTemplate(models.Model): + """Inherited this model for adding some fields that help to check the + message template is a delivery, invoice, purchase, or sale order + template """ + _inherit = 'mail.template' + + is_delivery_template = fields.Boolean(string='Delivery Template', + help="To check the message template" + " for sending delivery " + "to whatsapp") + is_invoice_template = fields.Boolean(string='Invoice Template', + help="To check the message template " + "for sending delivery " + "to whatsapp") + is_purchase_template = fields.Boolean(string="Purchase Template", + help="To check the message template " + "sending purchase order to" + " whatsapp") + is_sale_template = fields.Boolean(string="Sale Template", + help="To check the message template for" + "sending sale order to whatsapp") diff --git a/all_in_one_whatsapp_integration/models/purchase_order.py b/all_in_one_whatsapp_integration/models/purchase_order.py new file mode 100644 index 000000000..10a8a1cb1 --- /dev/null +++ b/all_in_one_whatsapp_integration/models/purchase_order.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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 base64 +import html2text +from odoo import models, _ +from odoo.exceptions import ValidationError + + +class PurchaseOrder(models.Model): + """Inherited the module for adding a button that helps to send whatsapp + message to the customer """ + _inherit = "purchase.order" + + def action_send_by_whatsapp(self): + """ When you click the send_by_whatsapp button, it will open a wizard + that contain the message to send to the whatsapp web page. """ + if not self.partner_id.mobile: + raise ValidationError(_('Add whatsapp mobile number in ' + 'sale order partner!')) + if not self.partner_id.mobile[0] == "+": + raise ValidationError(_('Please add a valid mobile' + 'number along with a valid country code!')) + twilio_whatsapp = (self.env["ir.config_parameter"].sudo().get_param + ("all_in_one_whatsapp_integration.twilio_whatsapp")) + if not twilio_whatsapp: + raise ValidationError(_("Please add your valid twilio" + "whatsapp number in settings")) + if twilio_whatsapp[0] != "+": + raise ValidationError(_("Please add a valid " + "twilio mobile number along with +")) + template_id = self.env.ref("all_in_one_whatsapp_integration." + "purchase_order_whatsapp_template").id + mail_template_values = ( + self.env["mail.template"] + .with_context(tpl_partners_only=True) + .browse(template_id) + .generate_email([self.id], fields=["body_html"])) + body_html = dict(mail_template_values)[self.id].pop("body_html", "") + whatsapp_message = html2text.html2text(body_html) + report = self.env["ir.actions.report"]._render_qweb_pdf( + "purchase.action_report_purchase_order", self.id) + report_attachment = self.env["ir.attachment"].sudo().create({ + "name": "Purchase Report", + "type": "binary", + "datas": base64.b64encode(report[0]), + "store_fname": base64.b64encode(report[0]), + "mimetype": "application/pdf", + "res_model": "purchase.order", + }) + return { + "type": "ir.actions.act_window", + "name": _("Whatsapp Message"), + "res_model": "send.whatsapp.message", + "target": "new", + "view_mode": "form", + "view_type": "form", + "context": { + "default_whatsapp_message": whatsapp_message, + "default_attachment_ids": [(4, report_attachment.id)], + }, + } diff --git a/all_in_one_whatsapp_integration/models/res_config_settings.py b/all_in_one_whatsapp_integration/models/res_config_settings.py new file mode 100644 index 000000000..08baed26d --- /dev/null +++ b/all_in_one_whatsapp_integration/models/res_config_settings.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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" + + account_sid = fields.Char(string="Account SID", + config_parameter='all_in_one_whatsapp_integration.' + 'account_sid', + help="Account SID of twilio account", ) + auth_token = fields.Char(string="Auth Token", + config_parameter='all_in_one_whatsapp_integration.' + 'auth_token', + help="Auth Token of twilio account") + twilio_whatsapp = fields.Char(string="Twilio Whatsapp Number", + config_parameter='all_in_one_whatsapp_integration' + '.twilio_whatsapp', + help="Whatsapp number of twilio account") + bearer_token = fields.Char(string="Whatsapp Access Token", + help="Authorization Token of Whatsapp Cloud " + "API", + config_parameter='all_in_one_whatsapp_integration.' + 'bearer_token', ) + whatsapp_no = fields.Char(string="Phone number ID", + help="Phone Number ID of Whatsapp Cloud API", + config_parameter='all_in_one_whatsapp_integration.' + 'whatsapp_no', ) + whatsapp_business = fields.Char(help="Business ID of Whatsapp Cloud API", + string="Whatsapp Business Account ID", + config_parameter='whatsapp_integration_' + 'odoo.whatsapp_business', ) diff --git a/all_in_one_whatsapp_integration/models/sale_order.py b/all_in_one_whatsapp_integration/models/sale_order.py new file mode 100644 index 000000000..707b0a2ba --- /dev/null +++ b/all_in_one_whatsapp_integration/models/sale_order.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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 base64 +import html2text +from odoo import models, _ +from odoo.exceptions import ValidationError + + +class SaleOrder(models.Model): + """Inherited the module for adding a button that helps to send whatsapp + message to the customer """ + _inherit = "sale.order" + + def action_send_by_whatsapp(self): + """When you click the send_by_whatsapp button, it will open a wizard + that contain the message to send to the whatsapp web page.""" + if not self.partner_id.mobile: + raise ValidationError(_('Add whatsapp mobile number in ' + 'sale order partner!')) + if not self.partner_id.mobile[0] == "+": + raise ValidationError(_('Please add a valid mobile' + 'number along with a valid country code!')) + twilio_whatsapp = (self.env["ir.config_parameter"].sudo().get_param + ("all_in_one_whatsapp_integration.twilio_whatsapp")) + if not twilio_whatsapp: + raise ValidationError(_("Please add your valid twilio" + "whatsapp number in settings")) + if twilio_whatsapp[0] != "+": + raise ValidationError(_("Please add a valid " + "twilio mobile number along with +")) + template_id = self.env.ref("all_in_one_whatsapp_integration." + "sale_order_whatsapp_template").id + mail_template_values = (self.env["mail.template"]. + with_context(tpl_partners_only=True). + browse(template_id).generate_email + ([self.id], fields=["body_html"])) + body_html = dict(mail_template_values)[self.id].pop("body_html", "") + whatsapp_message = html2text.html2text(body_html) + report = self.env["ir.actions.report"]._render_qweb_pdf( + "sale.action_report_saleorder", self.id) + report_attachment = self.env["ir.attachment"].sudo().create({ + "name": "Sale Report", + "type": "binary", + "datas": base64.b64encode(report[0]), + "store_fname": base64.b64encode(report[0]), + "mimetype": "application/pdf", + "res_model": "sale.order", + }) + return { + "type": "ir.actions.act_window", + "name": _("Whatsapp Message"), + "res_model": "send.whatsapp.message", + "target": "new", + "view_mode": "form", + "view_type": "form", + "context": { + "default_whatsapp_message": whatsapp_message, + "default_attachment_ids": [(4, report_attachment.id)], + "default_attachment_id": report_attachment.id, + }, + } diff --git a/all_in_one_whatsapp_integration/models/stock_picking.py b/all_in_one_whatsapp_integration/models/stock_picking.py new file mode 100644 index 000000000..2eb25b85b --- /dev/null +++ b/all_in_one_whatsapp_integration/models/stock_picking.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions (Contact : 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 base64 +import html2text +from odoo import models, _ +from odoo.exceptions import ValidationError + + +class StockPicking(models.Model): + """Inherited the module for adding a button that helps to send whatsapp + message to the customer """ + _inherit = 'stock.picking' + + def action_send_by_whatsapp(self): + """When you click the send_by_whatsapp button, it will open a wizard + that contain the message to send to the whatsapp web page.""" + if not self.partner_id.mobile: + raise ValidationError(_( + 'Add whatsapp mobile number in sale order partner!')) + if not self.partner_id.mobile[0] == '+': + raise ValidationError(_( + 'Please add a valid mobile number along with a valid ' + 'country code!')) + twilio_whatsapp = (self.env['ir.config_parameter'] + .sudo().get_param('all_in_one_whatsapp_integration.' + 'twilio_whatsapp')) + if twilio_whatsapp[0] != '+': + raise ValidationError(_( + 'Please add a valid twilio mobile number along with +')) + template_id = self.env.ref('all_in_one_whatsapp_integration.' + 'stock_picking_whatsapp_template').id + mail_template_values = (self.env['mail.template'] + .with_context(tpl_partners_only=True). + browse(template_id).generate_email + ([self.id], fields=['body_html'])) + body_html = dict(mail_template_values)[self.id].pop('body_html', '') + whatsapp_message = html2text.html2text(body_html) + report = (self.env['ir.actions.report']._render_qweb_pdf + ('stock.action_report_delivery', self.id)) + report_attachment = self.env['ir.attachment'].sudo().create({ + 'name': 'Delivery Report', + 'type': 'binary', + 'datas': base64.b64encode(report[0]), + 'store_fname': base64.b64encode(report[0]), + 'mimetype': 'application/pdf', + 'res_model': 'stock.picking', + }) + return { + 'type': 'ir.actions.act_window', + 'name': _('Whatsapp Message'), + 'res_model': 'send.whatsapp.message', + 'target': 'new', + 'view_mode': 'form', + 'view_type': 'form', + 'context': {'default_whatsapp_message': whatsapp_message, + 'default_attachment_ids': [(4, + report_attachment.id)]}, + } diff --git a/all_in_one_whatsapp_integration/security/ir.model.access.csv b/all_in_one_whatsapp_integration/security/ir.model.access.csv new file mode 100644 index 000000000..0f1c44d68 --- /dev/null +++ b/all_in_one_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_send_whatsapp_message,access.send.whatsapp.message,model_send_whatsapp_message,base.group_user,1,1,1,1 diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/check.png b/all_in_one_whatsapp_integration/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/check.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/chevron.png b/all_in_one_whatsapp_integration/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/chevron.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/cogs.png b/all_in_one_whatsapp_integration/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/cogs.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/consultation.png b/all_in_one_whatsapp_integration/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/consultation.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/ecom-black.png b/all_in_one_whatsapp_integration/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/ecom-black.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/education-black.png b/all_in_one_whatsapp_integration/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/education-black.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/hotel-black.png b/all_in_one_whatsapp_integration/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/hotel-black.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/license.png b/all_in_one_whatsapp_integration/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/license.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/lifebuoy.png b/all_in_one_whatsapp_integration/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/lifebuoy.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/manufacturing-black.png b/all_in_one_whatsapp_integration/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/manufacturing-black.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/pos-black.png b/all_in_one_whatsapp_integration/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/pos-black.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/puzzle.png b/all_in_one_whatsapp_integration/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/puzzle.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/restaurant-black.png b/all_in_one_whatsapp_integration/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/restaurant-black.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/service-black.png b/all_in_one_whatsapp_integration/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/service-black.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/trading-black.png b/all_in_one_whatsapp_integration/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/trading-black.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/training.png b/all_in_one_whatsapp_integration/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/training.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/update.png b/all_in_one_whatsapp_integration/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/update.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/user.png b/all_in_one_whatsapp_integration/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/user.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/icons/wrench.png b/all_in_one_whatsapp_integration/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/icons/wrench.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/categories.png b/all_in_one_whatsapp_integration/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/categories.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/check-box.png b/all_in_one_whatsapp_integration/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/check-box.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/compass.png b/all_in_one_whatsapp_integration/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/compass.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/corporate.png b/all_in_one_whatsapp_integration/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/corporate.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/customer-support.png b/all_in_one_whatsapp_integration/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/customer-support.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/cybrosys-logo.png b/all_in_one_whatsapp_integration/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/cybrosys-logo.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/features.png b/all_in_one_whatsapp_integration/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/features.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/logo.png b/all_in_one_whatsapp_integration/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/logo.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/pictures.png b/all_in_one_whatsapp_integration/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/pictures.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/pie-chart.png b/all_in_one_whatsapp_integration/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/pie-chart.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/right-arrow.png b/all_in_one_whatsapp_integration/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/right-arrow.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/star.png b/all_in_one_whatsapp_integration/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/star.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/support.png b/all_in_one_whatsapp_integration/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/support.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/misc/whatsapp.png b/all_in_one_whatsapp_integration/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/misc/whatsapp.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/modules/11.png b/all_in_one_whatsapp_integration/static/description/assets/modules/11.png new file mode 100644 index 000000000..eb3f8652f Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/modules/11.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/modules/12.png b/all_in_one_whatsapp_integration/static/description/assets/modules/12.png new file mode 100644 index 000000000..3415917c2 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/modules/12.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/modules/13.png b/all_in_one_whatsapp_integration/static/description/assets/modules/13.png new file mode 100644 index 000000000..7a9d3b1f6 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/modules/13.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/modules/14.png b/all_in_one_whatsapp_integration/static/description/assets/modules/14.png new file mode 100644 index 000000000..c6a41b7ec Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/modules/14.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/modules/15.png b/all_in_one_whatsapp_integration/static/description/assets/modules/15.png new file mode 100644 index 000000000..33a2b2e25 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/modules/15.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/modules/16.png b/all_in_one_whatsapp_integration/static/description/assets/modules/16.png new file mode 100644 index 000000000..0d814d2db Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/modules/16.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/1.1.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/1.1.png new file mode 100644 index 000000000..7e4dfbf67 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/1.1.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/1.3.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/1.3.png new file mode 100644 index 000000000..f990b30fe Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/1.3.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/1.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..fb42eaa59 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/1.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/10.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/10.png new file mode 100644 index 000000000..dd46e2ab9 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/10.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/11.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/11.png new file mode 100644 index 000000000..63f1ead6e Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/11.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/2.1.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/2.1.png new file mode 100644 index 000000000..7cffcd5d0 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/2.1.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/2.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..f91190638 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/2.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/3.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..29a92c096 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/3.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/4.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..caf7fb7fb Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/4.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/5.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..fc6cb8ff3 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/5.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/6.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..a6278a5c5 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/6.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/7.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..99e8743c3 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/7.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/8.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..f6491de6c Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/8.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/9.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..444ccf86a Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/9.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/a.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/a.png new file mode 100644 index 000000000..9f759406d Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/a.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/a1.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/a1.png new file mode 100644 index 000000000..fb9830b34 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/a1.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/a3.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/a3.png new file mode 100644 index 000000000..758bd76ad Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/a3.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c1.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c1.png new file mode 100644 index 000000000..0aeb6fb00 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c1.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c10.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c10.png new file mode 100644 index 000000000..d870e6da3 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c10.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c11.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c11.png new file mode 100644 index 000000000..b2013e3dc Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c11.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c12.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c12.png new file mode 100644 index 000000000..eadb72c3f Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c12.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c13.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c13.png new file mode 100644 index 000000000..ed5c3fa6a Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c13.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c14.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c14.png new file mode 100644 index 000000000..a95c136f5 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c14.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c15.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c15.png new file mode 100644 index 000000000..19192757c Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c15.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c16.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c16.png new file mode 100644 index 000000000..3c320f7bf Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c16.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c17.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c17.png new file mode 100644 index 000000000..b80321453 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c17.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c18.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c18.png new file mode 100644 index 000000000..782d4fd7a Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c18.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c2.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c2.png new file mode 100644 index 000000000..113711a63 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c2.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c3.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c3.png new file mode 100644 index 000000000..1fe11704b Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c3.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c4.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c4.png new file mode 100644 index 000000000..3d436b336 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c4.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c5.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c5.png new file mode 100644 index 000000000..e3d190523 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c5.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c6.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c6.png new file mode 100644 index 000000000..c6ac3539e Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c6.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c7.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c7.png new file mode 100644 index 000000000..935f57583 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c7.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c8.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c8.png new file mode 100644 index 000000000..79a6134aa Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c8.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/c9.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c9.png new file mode 100644 index 000000000..c6aa1805d Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/c9.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr1.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr1.png new file mode 100644 index 000000000..45913fa7b Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr1.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr2.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr2.png new file mode 100644 index 000000000..2c04ced07 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr2.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr3.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr3.png new file mode 100644 index 000000000..ae70d0c23 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr3.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr4.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr4.png new file mode 100644 index 000000000..119c76379 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr4.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr5.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr5.png new file mode 100644 index 000000000..6821c26d2 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/cr5.png differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/hero.gif b/all_in_one_whatsapp_integration/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..30fa7042f Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/hero.gif differ diff --git a/all_in_one_whatsapp_integration/static/description/assets/screenshots/t88.png b/all_in_one_whatsapp_integration/static/description/assets/screenshots/t88.png new file mode 100644 index 000000000..691042f15 Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/assets/screenshots/t88.png differ diff --git a/all_in_one_whatsapp_integration/static/description/banner.png b/all_in_one_whatsapp_integration/static/description/banner.png new file mode 100644 index 000000000..bb580b85b Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/banner.png differ diff --git a/all_in_one_whatsapp_integration/static/description/icon.png b/all_in_one_whatsapp_integration/static/description/icon.png new file mode 100644 index 000000000..46c24cabb Binary files /dev/null and b/all_in_one_whatsapp_integration/static/description/icon.png differ diff --git a/all_in_one_whatsapp_integration/static/description/index.html b/all_in_one_whatsapp_integration/static/description/index.html new file mode 100644 index 000000000..0c8510605 --- /dev/null +++ b/all_in_one_whatsapp_integration/static/description/index.html @@ -0,0 +1,959 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ All In One WhatsApp Integration Odoo16

+

+ WhatsApp Integration In Sale Order, Purchase Order, Delivery Order with Twilio and CloudAPI

+ +
+
+ +
+
+

+ Overview +

+
+
+

+ This Module Helps you to Send a Whatsapp Message to your + Partners that are in Sale Order, Purchase Order, Invoice + and Bills, and Deliver Orders. +

+
+
+
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Send Sale Order Details and Invoice Through WhatsApp to + Users .

+
+
+
+
+ +
+
+

+ Send Purchase Order Details and Bill Through WhatsApp + to + Users.

+
+
+
+
+ +
+
+

+ Send Delivery Details and Receipt Through WhatsApp to + Users.

+
+
+ +
+
+ +
+
+

+ Send WhatsApp Message by Twilio Method

+
+
+
+
+ +
+
+

+ Send WhatsApp Message by WhatsApp Web Method

+
+
+
+
+ +
+
+

+ Send WhatsApp Message through Livechat

+
+
+
+
+ +
+
+

+ Screenshots +

+
+
+

+ Get Twilio Credentials

+

+ Go to the Twilio website at https://www.twilio.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 Twilio Console. You can find + the Link to the Console in the top right Corner of the Website. + In the Twilio Console, you will see a Sidebar on the left. + Click on the "Get a Trial Number" button to obtain a Phone + Number for Testing

+

+ In the Settings page, you will find your Account SID (a unique + identifier for your Twilio account) and your Auth Token (used + for authentication). These Credentials will be Required to make API + Requests. +

+ +
+
+

+ Twilio Configuration in Odoo

+

+ Go to Settings and add the credentials under the + Twilio Credentials for Whatsapp.

+ +
+
+

+

+ Add whatsapp mobile number to the sale order partner.

+ +
+
+

Send Quotation through whatsapp

+

+ Go to Sales -> Quotation ->Click on the Button "SEND BY + WHATSAPP"

+ +
+
+

Using Twilio

+

+ Choose 'Twilio' as the 'Send Using' method and click send

+ +
+
+

+

+ The message will be sent as shown below.

+ +
+
+

Get Cloud API WhatsApp Credentials

+

+ To get cloud API whatsapp credential first you need a facebook + account. Go to the + https://developers.facebook.com website, and you can sign up + your developer facebook account using the + facebook account and whatsapp business account.

+ +
+
+

+

+ After Logging in, there has an option 'My Apps', from here we + can access all your apps in the facebook developer account.

+

+ From there we need to create new app for the whatsapp cloud + integration. There has 'Create App' option to create a new app.

+ +
+
+

+

+ It opens a new window, here there some option to choose, select + 'Other' and click on 'Next' button.

+ +
+
+

+

+ Select app type 'Business' and click on 'Next' button.

+ +
+
+

+

+ Provide App name and App contact email, select Business account + as 'Test Business', click on Create App.

+ +
+
+

+

+ Then after we need to integrate the Whatsapp with our app that + we created by clicking on 'Set up'.

+ +
+
+

+

+ There has API set up option menu under Whatsapp on the left + side,from there we can access our Temporary + Access Token, Phone Number ID and Whatsapp Business Account ID.

+ +
+
+

+

+ We can Choose a mobile number from 'To' option, can send + message to the number by clicking the 'Send + Message' button.

+ +
+
+

+

It will send a demonstration message like shown below

+ +
+
+

Whatsapp Cloud API Configuration in Odoo

+

+ Go to Settings and add the credentials under the + Whatsapp Cloud API Credentials.

+ +
+
+

Send Quotation through whatsapp

+

+ Go to Sales -> Quotation ->Click on the Button "SEND BY + WHATSAPP"

+ +
+
+

Using Cloud WhatsApp

+

+ Choose 'Cloud WhatsApp' as the Send Using method, We have Two + options Using , Text and Document. Choose one and click Send.

+ +
+
+

+

+ The message will be sent as shown below.

+ +
+
+

Using WhatsApp Web

+

+ Choose 'WhatsApp Web' as the Send Using method. It will redirect + you to WhatsApp Web and you can send message through it.

+ +
+
+

+

+ The message will be sent as shown below.

+ +
+
+

Send By WhatsApp in Purchase Module

+

Go to Purchase -> RFQ ->Click on the Button "SEND BY + WHATSAPP"

+ +
+
+

Send By WhatsApp in Invoicing Module

+

Go to Invoicing -> Customers -> Invoice ->Click on the Button "SEND BY + WHATSAPP"

+ +
+
+

Send By WhatsApp in Inventory Module

+

Got to Inventory -> Transfer ->Click on the Button "SEND BY + WHATSAPP"

+ +
+
+

WhatsApp Message Through Livechat

+

+ First add the Number to the related partner of the user. + Make sure do not include the spaces.

+ +
+
+

+

+ We can receive realtime whatsapp messages to the Business + whatsapp number through Live Chat. For that + first we need to configure Webhooks from facebook developer + account. There has 'Configuration' menu + under Whatsapp on left side, from there we configure webhook + for the realtime message chat.

+ +
+
+

+

+ We add Call back url for the webhook here. It will trigger a + response while we receive whatsapp message + to the Business whatsapp. Also need to provide a verification + token to connect it, click on 'Verify and Save' Button. + The Webhook format is "ip_address/whatsapp_message".

+ +
+
+

+

+ Then after we need to choose 'message' as webhook field by + clicking the manage button. Enable the messages option and click Done

+ +
+
+

Message Through Livechat

+

+ We get the realtime whatsapp chats of business whatsapp through + the Live Chat.

+ +
+
+

+

+ We can also send messages through the LiveChat.

+ +
+
+

WhatsApp View

+

+ The portal users view will be as shown

+ +
+
+ +
+
+ +
+

+ 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/all_in_one_whatsapp_integration/views/account_move_views.xml b/all_in_one_whatsapp_integration/views/account_move_views.xml new file mode 100644 index 000000000..60483b006 --- /dev/null +++ b/all_in_one_whatsapp_integration/views/account_move_views.xml @@ -0,0 +1,34 @@ + + + + + + account.move.view.form.inherit.all.in.one.whatsapp.integration + + account.move + + + +