diff --git a/whatsapp_mail_messaging/__init__.py b/whatsapp_mail_messaging/__init__.py index 9c65d6d4f..ad948c648 100644 --- a/whatsapp_mail_messaging/__init__.py +++ b/whatsapp_mail_messaging/__init__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Copyright (C) 2024-TODAY Cybrosys Technologies() # Author: Cybrosys Techno Solutions() # # You can modify it under the terms of the GNU LESSER diff --git a/whatsapp_mail_messaging/__manifest__.py b/whatsapp_mail_messaging/__manifest__.py index f8a3edde3..27c302934 100644 --- a/whatsapp_mail_messaging/__manifest__.py +++ b/whatsapp_mail_messaging/__manifest__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Copyright (C) 2024-TODAY Cybrosys Technologies() # Author: Cybrosys Techno Solutions() # # You can modify it under the terms of the GNU LESSER @@ -22,7 +22,7 @@ { 'name': 'Odoo Whatsapp Connector', - 'version': '15.0.1.0.1', + 'version': '15.0.1.1.1', '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 a6d26c5b4..b82d706f7 100644 --- a/whatsapp_mail_messaging/doc/changelog.md +++ b/whatsapp_mail_messaging/doc/changelog.md @@ -3,4 +3,8 @@ #### 18.12.2021 #### Version 15.0.1.0.0 #### ADD -- Initial commit +- Initial commit for Odoo Whatsapp Connector + +#### UPDT + +- Added whatsapp message template feature. \ No newline at end of file diff --git a/whatsapp_mail_messaging/model/__init__.py b/whatsapp_mail_messaging/model/__init__.py index b999986f0..4e1361a82 100644 --- a/whatsapp_mail_messaging/model/__init__.py +++ b/whatsapp_mail_messaging/model/__init__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Copyright (C) 2024-TODAY Cybrosys Technologies() # Author: Cybrosys Techno Solutions() # # You can modify it under the terms of the GNU LESSER @@ -19,7 +19,8 @@ # If not, see . # ############################################################################# - 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 405648025..ee913a24f 100644 --- a/whatsapp_mail_messaging/model/account_move.py +++ b/whatsapp_mail_messaging/model/account_move.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Copyright (C) 2024-TODAY Cybrosys Technologies() # Author: Cybrosys Techno Solutions() # # You can modify it under the terms of the GNU LESSER @@ -32,9 +32,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 579bdb8b3..e2f2e46d5 100644 --- a/whatsapp_mail_messaging/model/sale_order.py +++ b/whatsapp_mail_messaging/model/sale_order.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Copyright (C) 2024-TODAY Cybrosys Technologies() # Author: Cybrosys Techno Solutions() # # You can modify it under the terms of the GNU LESSER @@ -32,8 +32,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/model/website.py b/whatsapp_mail_messaging/model/website.py index 945cfd0b4..d77d61323 100644 --- a/whatsapp_mail_messaging/model/website.py +++ b/whatsapp_mail_messaging/model/website.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Copyright (C) 2024-TODAY Cybrosys Technologies() # Author: Cybrosys Techno Solutions() # # You can modify it under the terms of the GNU LESSER diff --git a/whatsapp_mail_messaging/static/description/assets/screenshots/whatsapp_mail_messaging_23.png b/whatsapp_mail_messaging/static/description/assets/screenshots/whatsapp_mail_messaging_23.png new file mode 100644 index 000000000..8b36d2449 Binary files /dev/null and b/whatsapp_mail_messaging/static/description/assets/screenshots/whatsapp_mail_messaging_23.png differ diff --git a/whatsapp_mail_messaging/static/description/index.html b/whatsapp_mail_messaging/static/description/index.html index 7c505718a..886486f4d 100644 --- a/whatsapp_mail_messaging/static/description/index.html +++ b/whatsapp_mail_messaging/static/description/index.html @@ -323,6 +323,13 @@ +
+

+ Create whatsapp message template for sales orders and invoices.

+ +

+ + + + 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..c8a6ab734 --- /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

+
+
+
+
+ + + + + + +
+
+
+
diff --git a/whatsapp_mail_messaging/wizard/__init__.py b/whatsapp_mail_messaging/wizard/__init__.py index d8ea509a3..0a9d1881b 100644 --- a/whatsapp_mail_messaging/wizard/__init__.py +++ b/whatsapp_mail_messaging/wizard/__init__.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Copyright (C) 2024-TODAY Cybrosys Technologies() # Author: Cybrosys Techno Solutions() # # You can modify it under the terms of the GNU LESSER diff --git a/whatsapp_mail_messaging/wizard/portal_share.py b/whatsapp_mail_messaging/wizard/portal_share.py index 6b27165d2..c7f632291 100644 --- a/whatsapp_mail_messaging/wizard/portal_share.py +++ b/whatsapp_mail_messaging/wizard/portal_share.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Copyright (C) 2024-TODAY Cybrosys Technologies() # Author: Cybrosys Techno Solutions() # # You can modify it under the terms of the GNU LESSER diff --git a/whatsapp_mail_messaging/wizard/wh_message_wizard.py b/whatsapp_mail_messaging/wizard/wh_message_wizard.py index 7165e78ad..ce912c8ec 100644 --- a/whatsapp_mail_messaging/wizard/wh_message_wizard.py +++ b/whatsapp_mail_messaging/wizard/wh_message_wizard.py @@ -3,7 +3,7 @@ # # Cybrosys Technologies Pvt. Ltd. # -# Copyright (C) 2021-TODAY Cybrosys Technologies() +# Copyright (C) 2024-TODAY Cybrosys Technologies() # Author: Cybrosys Techno Solutions() # # You can modify it under the terms of the GNU LESSER