@ -0,0 +1,44 @@ |
|||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg |
|||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
Odoo Whatsapp Connector |
|||
======================= |
|||
Odoo Whatsapp Connector For Sales, Invoice and Floating button in Website |
|||
|
|||
Configuration |
|||
============= |
|||
* No additional configurations needed |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
Credits |
|||
------- |
|||
* Developers: Nishad@cybrosys |
|||
version 14: Sayooj A O @cybrosys |
|||
|
|||
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 <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
|||
|
|||
|
@ -0,0 +1,25 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Sayooj A O (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
|
|||
from . import website |
|||
from . import sale_order |
|||
from . import account_move |
@ -0,0 +1,89 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Sayooj A O (<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
|
|||
from itertools import groupby |
|||
|
|||
from odoo import models, _ |
|||
from odoo.exceptions import UserError |
|||
|
|||
|
|||
class Account(models.Model): |
|||
_inherit = 'account.move' |
|||
|
|||
def action_send_whatsapp(self): |
|||
compose_form_id = self.env.ref('whatsapp_mail_messaging.whatsapp_message_wizard_form').id |
|||
ctx = dict(self.env.context) |
|||
message = "Hi" + " " + self.partner_id.name + ',' + '\n' + "Here is your invoice" + ' ' + self.name + ' ' + "amounting" + ' ' + str( |
|||
self.amount_total) + self.currency_id.symbol + ' ' + "from " + self.company_id.name + ". Please remit payment at your earliest convenience. " + '\n' + \ |
|||
"Please use the following communication for your payment" + ' ' + self.name |
|||
ctx.update({ |
|||
'default_message': message, |
|||
'default_partner_id': self.partner_id.id, |
|||
'default_mobile': self.partner_id.mobile, |
|||
'default_image_1920': self.partner_id.image_1920, |
|||
}) |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'view_mode': 'form', |
|||
'res_model': 'whatsapp.message.wizard', |
|||
'views': [(compose_form_id, 'form')], |
|||
'view_id': compose_form_id, |
|||
'target': 'new', |
|||
'context': ctx, |
|||
} |
|||
|
|||
def check_customers(self, partner_ids): |
|||
partners = groupby(partner_ids) |
|||
return next(partners, True) and not next(partners, False) |
|||
|
|||
def action_whatsapp_multi(self): |
|||
account_move_ids = self.env['account.move'].browse(self.env.context.get('active_ids')) |
|||
partner_ids = [] |
|||
for account_move in account_move_ids: |
|||
partner_ids.append(account_move.partner_id.id) |
|||
partner_check = self.check_customers(partner_ids) |
|||
if partner_check: |
|||
account_move_numbers = account_move_ids.mapped('name') |
|||
account_move_numbers = "\n".join(account_move_numbers) |
|||
compose_form_id = self.env.ref('whatsapp_mail_messaging.whatsapp_message_wizard_form').id |
|||
ctx = dict(self.env.context) |
|||
message = "Hi" + " " + self.partner_id.name + ',' + '\n' + "Your Orders are" + '\n' + account_move_numbers + \ |
|||
' ' + "is ready for review.Do not hesitate to contact us if you have any questions." |
|||
ctx.update({ |
|||
'default_message': message, |
|||
'default_partner_id': account_move_ids[0].partner_id.id, |
|||
'default_mobile': account_move_ids[0].partner_id.mobile, |
|||
'default_image_1920': account_move_ids[0].partner_id.image_1920, |
|||
}) |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'view_mode': 'form', |
|||
'res_model': 'whatsapp.message.wizard', |
|||
'views': [(compose_form_id, 'form')], |
|||
'view_id': compose_form_id, |
|||
'target': 'new', |
|||
'context': ctx, |
|||
} |
|||
else: |
|||
raise UserError(_( |
|||
'It seems that you have selected Invoices of more than one customer.' |
|||
'Try select Invoices of an unique customer')) |
@ -0,0 +1,88 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Sayooj A O(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
|
|||
from itertools import groupby |
|||
|
|||
from odoo import models, _ |
|||
from odoo.exceptions import UserError |
|||
|
|||
|
|||
class Sale(models.Model): |
|||
_inherit = 'sale.order' |
|||
|
|||
def action_send_whatsapp(self): |
|||
compose_form_id = self.env.ref('whatsapp_mail_messaging.whatsapp_message_wizard_form').id |
|||
ctx = dict(self.env.context) |
|||
message = "Hi" + " " + self.partner_id.name + ',' + '\n' + "Your quotation" + ' ' + self.name + ' ' + "amounting" + ' ' + str( |
|||
self.amount_total) + self.currency_id.symbol + ' ' + "is ready for review.Do not hesitate to contact us if you have any questions." |
|||
ctx.update({ |
|||
'default_message': message, |
|||
'default_partner_id': self.partner_id.id, |
|||
'default_mobile': self.partner_id.mobile, |
|||
'default_image_1920': self.partner_id.image_1920, |
|||
}) |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'view_mode': 'form', |
|||
'res_model': 'whatsapp.message.wizard', |
|||
'views': [(compose_form_id, 'form')], |
|||
'view_id': compose_form_id, |
|||
'target': 'new', |
|||
'context': ctx, |
|||
} |
|||
|
|||
def check_customers(self, partner_ids): |
|||
partners = groupby(partner_ids) |
|||
return next(partners, True) and not next(partners, False) |
|||
|
|||
def action_whatsapp_multi(self): |
|||
sale_order_ids = self.env['sale.order'].browse(self.env.context.get('active_ids')) |
|||
partner_ids = [] |
|||
for sale in sale_order_ids: |
|||
partner_ids.append(sale.partner_id.id) |
|||
partner_check = self.check_customers(partner_ids) |
|||
if partner_check: |
|||
sale_numbers = sale_order_ids.mapped('name') |
|||
sale_numbers = "\n".join(sale_numbers) |
|||
compose_form_id = self.env.ref('whatsapp_mail_messaging.whatsapp_message_wizard_form').id |
|||
ctx = dict(self.env.context) |
|||
message = "Hi" + " " + self.partner_id.name + ',' + '\n' + "Your Orders are" + '\n' + sale_numbers + \ |
|||
' ' + '\n' + "is ready for review.Do not hesitate to contact us if you have any questions." |
|||
ctx.update({ |
|||
'default_message': message, |
|||
'default_partner_id': sale_order_ids[0].partner_id.id, |
|||
'default_mobile': sale_order_ids[0].partner_id.mobile, |
|||
'default_image_1920': sale_order_ids[0].partner_id.image_1920, |
|||
}) |
|||
return { |
|||
'type': 'ir.actions.act_window', |
|||
'view_mode': 'form', |
|||
'res_model': 'whatsapp.message.wizard', |
|||
'views': [(compose_form_id, 'form')], |
|||
'view_id': compose_form_id, |
|||
'target': 'new', |
|||
'context': ctx, |
|||
} |
|||
else: |
|||
raise UserError(_( |
|||
'It seems that you have selected orders of more than one customer.' |
|||
'Try select orders of an unique customer')) |
@ -0,0 +1,29 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2020-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Sayooj A O(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
|
|||
from odoo import fields, models |
|||
|
|||
|
|||
class Website(models.Model): |
|||
_inherit = 'website' |
|||
|
|||
mobile_number = fields.Char(string='Mobile Number') |
Before Width: | Height: | Size: 33 KiB |
After Width: | Height: | Size: 325 KiB |
After Width: | Height: | Size: 8.5 KiB |
After Width: | Height: | Size: 7.4 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 8.0 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 733 B |
Before Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 404 B |
After Width: | Height: | Size: 492 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 911 B |
Before Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 673 B |
Before Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 878 B |
Before Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 905 B |
Before Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 839 B |
Before Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 427 B |
Before Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 180 KiB |
After Width: | Height: | Size: 184 KiB |
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 87 KiB |
After Width: | Height: | Size: 113 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 116 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 111 KiB |
After Width: | Height: | Size: 87 KiB |
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 505 KiB |
After Width: | Height: | Size: 32 KiB |
After Width: | Height: | Size: 93 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 49 KiB |
After Width: | Height: | Size: 239 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 165 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 157 KiB |
After Width: | Height: | Size: 51 KiB |
After Width: | Height: | Size: 89 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 221 KiB |
After Width: | Height: | Size: 75 KiB |
Before Width: | Height: | Size: 797 KiB |
After Width: | Height: | Size: 204 KiB |
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 36 KiB |