diff --git a/whatsapp_mail_messaging/__manifest__.py b/whatsapp_mail_messaging/__manifest__.py index 8cff9ad6d..bf4a953fd 100644 --- a/whatsapp_mail_messaging/__manifest__.py +++ b/whatsapp_mail_messaging/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################# { 'name': 'Odoo Whatsapp Connector', - 'version': '13.0.1.0.0', + 'version': '13.0.1.1.0', 'category': 'Extra Tools', 'summary': """Odoo Whatsapp Connector For Sales, Invoice, and Floating button in Website""", 'description': """Added options for sending Whatsapp messages and Mails in systray bar,sale order, invoices, @@ -38,6 +38,8 @@ 'views/sale_order_inherited.xml', 'views/account_move_inherited.xml', 'views/website_inherited.xml', + 'views/res_company_views.xml', + 'views/res_config_settings_views.xml', 'wizard/wh_message_wizard.xml', 'wizard/portal_share_inherited.xml', 'security/ir.model.access.csv', diff --git a/whatsapp_mail_messaging/doc/changelog.md b/whatsapp_mail_messaging/doc/changelog.md index 29478f745..afad468fd 100644 --- a/whatsapp_mail_messaging/doc/changelog.md +++ b/whatsapp_mail_messaging/doc/changelog.md @@ -3,8 +3,11 @@ #### 22.06.2021 #### Version 13.0.1.0.0 #### ADD -- Initial commit - +- Initial commit Odoo Whatsapp Connector +#### 20.05.2024 +#### Version 13.0.1.1.0 +#### UPDT +- Added whatsapp message template feature. diff --git a/whatsapp_mail_messaging/model/__init__.py b/whatsapp_mail_messaging/model/__init__.py index f2695008d..e14804cee 100644 --- a/whatsapp_mail_messaging/model/__init__.py +++ b/whatsapp_mail_messaging/model/__init__.py @@ -22,3 +22,5 @@ from . import website from . import sale_order from . import account_move +from . import res_company +from . import res_config_settings diff --git a/whatsapp_mail_messaging/model/account_move.py b/whatsapp_mail_messaging/model/account_move.py index 897dd981d..46cc14e15 100644 --- a/whatsapp_mail_messaging/model/account_move.py +++ b/whatsapp_mail_messaging/model/account_move.py @@ -29,9 +29,11 @@ class Account(models.Model): 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( + message_template = self.company_id.whatsapp_message + default_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 + message = message_template if message_template else default_message ctx.update({ 'default_message': message, 'default_partner_id': self.partner_id.id, diff --git a/whatsapp_mail_messaging/model/res_company.py b/whatsapp_mail_messaging/model/res_company.py new file mode 100644 index 000000000..86d6d6a75 --- /dev/null +++ b/whatsapp_mail_messaging/model/res_company.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ResCompany(models.Model): + """ + Extends the 'res.company' model to include WhatsApp message template. + """ + _inherit = 'res.company' + + whatsapp_message = fields.Text(string="Message Template", + help="whatsapp message template") diff --git a/whatsapp_mail_messaging/model/res_config_settings.py b/whatsapp_mail_messaging/model/res_config_settings.py new file mode 100644 index 000000000..1c7de3844 --- /dev/null +++ b/whatsapp_mail_messaging/model/res_config_settings.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + """ + Extends the 'res.config.settings' model to include additional configuration settings. + """ + _inherit = 'res.config.settings' + + whatsapp_message = fields.Text(string="Message Template", + related='company_id.whatsapp_message', + readonly=False) diff --git a/whatsapp_mail_messaging/model/sale_order.py b/whatsapp_mail_messaging/model/sale_order.py index 681e34e63..4b784b10b 100644 --- a/whatsapp_mail_messaging/model/sale_order.py +++ b/whatsapp_mail_messaging/model/sale_order.py @@ -29,8 +29,10 @@ class Sale(models.Model): 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( + message_template = self.company_id.whatsapp_message + default_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." + message = message_template if message_template else default_message ctx.update({ 'default_message': message, 'default_partner_id': self.partner_id.id, diff --git a/whatsapp_mail_messaging/static/description/assets/screenshots/20.png b/whatsapp_mail_messaging/static/description/assets/screenshots/20.png new file mode 100644 index 000000000..d5a8457c1 Binary files /dev/null and b/whatsapp_mail_messaging/static/description/assets/screenshots/20.png differ diff --git a/whatsapp_mail_messaging/static/description/index.html b/whatsapp_mail_messaging/static/description/index.html index e15ae2647..229389017 100644 --- a/whatsapp_mail_messaging/static/description/index.html +++ b/whatsapp_mail_messaging/static/description/index.html @@ -247,6 +247,17 @@ style="background-color: #3498DB !important; border: 4px solid #d6eaf8 !important; box-shadow: 0px 0px 0px 4px #ebf5fb !important; color: #fff !important; height: 35px; width: 35px; border-radius: 50% !important; font-size: 1.1rem !important;">
14
+
Create whatsapp message template for sales orders and invoices.
+ + + +
+
+
+
15
+
In the website form view we can define the number along with country code required for communicating with the website responsible.
@@ -257,7 +268,7 @@
-
15
+
16
There will be a whatsapp icon present in the website.
@@ -268,7 +279,7 @@
-
16
+
17
By clicking on the whatsapp floating icon it will redirect to whatsapp web with the recipient as the number specified in corresponding website
@@ -279,7 +290,7 @@
-
17
+
18
We will have a share menu in documents like sales order, invoices, purchase etc..
@@ -290,7 +301,7 @@
-
18
+
19
By clicking on that there will be an additional option 'Whatsapp" in the popup screen where we can add the customer and additional contents if we need.
@@ -302,7 +313,7 @@
-
19
+
20
After click on send first it will redirected to then whatsapp web and then to corresponding contact in our whatsapp along with the custom message and link for accessing the document.
@@ -310,7 +321,6 @@
-
diff --git a/whatsapp_mail_messaging/views/res_company_views.xml b/whatsapp_mail_messaging/views/res_company_views.xml new file mode 100644 index 000000000..b0ffa37ae --- /dev/null +++ b/whatsapp_mail_messaging/views/res_company_views.xml @@ -0,0 +1,16 @@ + + + + + res.company.view.form.inherit.whatsapp.mail.messaging + + res.company + + + + + + + + diff --git a/whatsapp_mail_messaging/views/res_config_settings_views.xml b/whatsapp_mail_messaging/views/res_config_settings_views.xml new file mode 100644 index 000000000..e56ae7480 --- /dev/null +++ b/whatsapp_mail_messaging/views/res_config_settings_views.xml @@ -0,0 +1,31 @@ + + + + + res.config.settings.view.form.inherit.whatsapp.mail.messaging + + res.config.settings + + + +

Whatsapp

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