diff --git a/whatsapp_redirect/__init__.py b/whatsapp_redirect/__init__.py new file mode 100644 index 000000000..9a0273096 --- /dev/null +++ b/whatsapp_redirect/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Nishad () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import models +from . import wizard diff --git a/whatsapp_redirect/__manifest__.py b/whatsapp_redirect/__manifest__.py new file mode 100644 index 000000000..40da58834 --- /dev/null +++ b/whatsapp_redirect/__manifest__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2018-TODAY Cybrosys Technologies (). +# Author: Nishad () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': 'Send Whatsapp Message', + 'version': '12.0.1.0.0', + 'summary': 'Send Message to partner via Whatsapp web', + 'description': 'Send Message to partner via Whatsapp web', + 'category': 'Extra Tools', + 'author': 'Cybrosys Techno solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': [ + 'base', + ], + 'data': [ + 'views/view.xml', + 'wizard/wizard.xml', + ], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'application': False, + 'auto_install': False, + 'license': 'AGPL-3', +} diff --git a/whatsapp_redirect/doc/RELEASE_NOTES.md b/whatsapp_redirect/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..a339300ab --- /dev/null +++ b/whatsapp_redirect/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 21.01.2019 +#### Version 12.0.1.0.0 +##### ADD +- Initial commit for Send Whatsapp Message Module \ No newline at end of file diff --git a/whatsapp_redirect/models/__init__.py b/whatsapp_redirect/models/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/whatsapp_redirect/models/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/whatsapp_redirect/models/models.py b/whatsapp_redirect/models/models.py new file mode 100644 index 000000000..129564691 --- /dev/null +++ b/whatsapp_redirect/models/models.py @@ -0,0 +1,16 @@ +from odoo import models, fields, api, _ + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + + def send_msg(self): + return {'type': 'ir.actions.act_window', + 'name': _('Whatsapp Message'), + 'res_model': 'whatsapp.message.wizard', + 'target': 'new', + 'view_mode': 'form', + 'view_type': 'form', + 'context': {'default_user_id': self.id}, + } diff --git a/whatsapp_redirect/readme.rst b/whatsapp_redirect/readme.rst new file mode 100644 index 000000000..34684d3fb --- /dev/null +++ b/whatsapp_redirect/readme.rst @@ -0,0 +1,31 @@ +====================== +Send Whatsapp Message +====================== +This module helps you to directly send messages to your +contacts through WhatsApp web. + +Tech +==== +* [Python] - Models +* [XML] - Odoo views + +Installation +============ +- www.odoo.com/documentation/12.0/setup/install.html +- Install our custom addon + +Bug Tracker +=========== +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Credits +======= +* Cybrosys Techno Solutions + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. + diff --git a/whatsapp_redirect/static/description/banner.png b/whatsapp_redirect/static/description/banner.png new file mode 100644 index 000000000..42824da9a Binary files /dev/null and b/whatsapp_redirect/static/description/banner.png differ diff --git a/whatsapp_redirect/static/description/icon.png b/whatsapp_redirect/static/description/icon.png new file mode 100644 index 000000000..a63c3668a Binary files /dev/null and b/whatsapp_redirect/static/description/icon.png differ diff --git a/whatsapp_redirect/static/description/index.html b/whatsapp_redirect/static/description/index.html new file mode 100644 index 000000000..82a352b5b --- /dev/null +++ b/whatsapp_redirect/static/description/index.html @@ -0,0 +1,362 @@ +
+
+

+ Whatsapp Web Integration +

+

+ Send messages via whatsapp +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ +
+
+

+ Overview +

+

+ Now chat with your customers WhatsApp...
+ The Whatsapp Web Integration module allows you to chat with customers through whatsapp, one of the popular messaging app. +

+

+ Configuration +

+

+ No additional configuration required +

+
+
+ +
+
+

+ Features +

+

+ + Send messages to partners +

+

+ + User friendly +

+
+
+ +
+
+

+ Screenshots +

+

+ + Enter the whatsapp number +

+
+ +
+

+ + Select 'whatsapp message' from partner form. +

+
+ +
+

+ + Enter the text that you have to send. +

+
+ +
+

+ + Choose Send option +

+
+ +
+

+ + The message is delivered to whatsapp web. +

+
+ +
+ +
+
+ +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

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

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
diff --git a/whatsapp_redirect/static/description/whatsapp-cybrosys-1.png b/whatsapp_redirect/static/description/whatsapp-cybrosys-1.png new file mode 100644 index 000000000..46b1a9200 Binary files /dev/null and b/whatsapp_redirect/static/description/whatsapp-cybrosys-1.png differ diff --git a/whatsapp_redirect/static/description/whatsapp-cybrosys-2.png b/whatsapp_redirect/static/description/whatsapp-cybrosys-2.png new file mode 100644 index 000000000..888ab3bf8 Binary files /dev/null and b/whatsapp_redirect/static/description/whatsapp-cybrosys-2.png differ diff --git a/whatsapp_redirect/static/description/whatsapp-cybrosys-3.png b/whatsapp_redirect/static/description/whatsapp-cybrosys-3.png new file mode 100644 index 000000000..f502628a3 Binary files /dev/null and b/whatsapp_redirect/static/description/whatsapp-cybrosys-3.png differ diff --git a/whatsapp_redirect/static/description/whatsapp-cybrosys-4.png b/whatsapp_redirect/static/description/whatsapp-cybrosys-4.png new file mode 100644 index 000000000..db0f4d586 Binary files /dev/null and b/whatsapp_redirect/static/description/whatsapp-cybrosys-4.png differ diff --git a/whatsapp_redirect/static/description/whatsapp-cybrosys-5.png b/whatsapp_redirect/static/description/whatsapp-cybrosys-5.png new file mode 100644 index 000000000..345ac3f91 Binary files /dev/null and b/whatsapp_redirect/static/description/whatsapp-cybrosys-5.png differ diff --git a/whatsapp_redirect/views/view.xml b/whatsapp_redirect/views/view.xml new file mode 100644 index 000000000..c7009ffe4 --- /dev/null +++ b/whatsapp_redirect/views/view.xml @@ -0,0 +1,17 @@ + + + + + res.partner.form + res.partner + + + +
+
+
+
+
+
+
\ No newline at end of file diff --git a/whatsapp_redirect/wizard/__init__.py b/whatsapp_redirect/wizard/__init__.py new file mode 100644 index 000000000..40272379f --- /dev/null +++ b/whatsapp_redirect/wizard/__init__.py @@ -0,0 +1 @@ +from . import wizard diff --git a/whatsapp_redirect/wizard/wizard.py b/whatsapp_redirect/wizard/wizard.py new file mode 100644 index 000000000..91b86561b --- /dev/null +++ b/whatsapp_redirect/wizard/wizard.py @@ -0,0 +1,24 @@ +from odoo import models, api, fields + + +class WhatsappSendMessage(models.TransientModel): + + _name = 'whatsapp.message.wizard' + + user_id = fields.Many2one('res.partner', string="Recipient") + mobile = fields.Char(related='user_id.mobile', required=True) + message = fields.Text(string="message", required=True) + + def send_message(self): + if self.message and self.mobile: + message_string = '' + message = self.message.split(' ') + for msg in message: + message_string = message_string + msg + '%20' + message_string = message_string[:(len(message_string) - 3)] + return { + 'type': 'ir.actions.act_url', + 'url': "https://api.whatsapp.com/send?phone="+self.user_id.mobile+"&text=" + message_string, + 'target': 'self', + 'res_id': self.id, + } \ No newline at end of file diff --git a/whatsapp_redirect/wizard/wizard.xml b/whatsapp_redirect/wizard/wizard.xml new file mode 100644 index 000000000..30395a65b --- /dev/null +++ b/whatsapp_redirect/wizard/wizard.xml @@ -0,0 +1,25 @@ + + + + + whatsapp.message.wizard.form + whatsapp.message.wizard + + +
+ + + + + + + + +
+
+
+
+
\ No newline at end of file