diff --git a/enhanced_document_management/doc/RELEASE_NOTES.md b/enhanced_document_management/doc/RELEASE_NOTES.md index 6504f8abf..2697c6126 100755 --- a/enhanced_document_management/doc/RELEASE_NOTES.md +++ b/enhanced_document_management/doc/RELEASE_NOTES.md @@ -5,3 +5,13 @@ #### ADD - Initial commit for Document Management + +## Module + +#### 19.05.2024 +#### Version 16.0.1.0.1 +#### BUG FIX + +- fixed the issue of contact name overrides the outline and unaligned delete + button in export page. + diff --git a/enhanced_document_management/static/src/css/kanban.css b/enhanced_document_management/static/src/css/kanban.css index 867c604ad..e79c4d3da 100755 --- a/enhanced_document_management/static/src/css/kanban.css +++ b/enhanced_document_management/static/src/css/kanban.css @@ -10,19 +10,6 @@ height: 140px; align-items: center; } -.o_kanban_record_title{ - margin-bottom: 4px; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - width: 100%; - } - .fa { - display: inline-block; - font: normal normal normal 14px/1 FontAwesome; - font-size: 15px; - text-rendering: auto; -} .check_box{ margin-left:90%; } diff --git a/whatsapp_mail_messaging/__manifest__.py b/whatsapp_mail_messaging/__manifest__.py index 81572787a..8144a9098 100644 --- a/whatsapp_mail_messaging/__manifest__.py +++ b/whatsapp_mail_messaging/__manifest__.py @@ -21,7 +21,7 @@ ############################################################################# { 'name': 'Odoo Whatsapp Connector', - 'version': '16.0.0.1.0', + 'version': '16.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, @@ -34,11 +34,12 @@ 'depends': ['sale', 'account', 'website','sale_management'], 'data': [ 'security/ir.model.access.csv', - 'views/selection_messages_views.xml', 'views/portal_whatsapp_view.xml', 'views/sale_order_inherited.xml', 'views/account_move_inherited.xml', 'views/website_inherited.xml', + 'views/res_config_settings_views.xml', + 'views/res_company_views.xml', 'wizard/wh_message_wizard.xml', 'wizard/portal_share_inherited.xml', ], diff --git a/whatsapp_mail_messaging/doc/changelog.md b/whatsapp_mail_messaging/doc/changelog.md index e764ee14b..3a9c8935c 100644 --- a/whatsapp_mail_messaging/doc/changelog.md +++ b/whatsapp_mail_messaging/doc/changelog.md @@ -7,6 +7,11 @@ #### 29.11.2023 -#### Version 16.0.0.1.0 +#### Version 16.0.1.0.1 #### BUGFIX - Added Default Message functionality where users can save message templates and use these templates for sending Whatsapp Message. + +#### 20.05.2024 +#### Version 16.0.1.1.0 +#### UPDT +- Added new 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 7a9f0b36c..16780b68b 100644 --- a/whatsapp_mail_messaging/model/__init__.py +++ b/whatsapp_mail_messaging/model/__init__.py @@ -22,4 +22,5 @@ from . import website from . import sale_order from . import account_move -from . import selection_messages +from . import res_config_settings +from . import res_company diff --git a/whatsapp_mail_messaging/model/account_move.py b/whatsapp_mail_messaging/model/account_move.py index a37595b48..6daab8195 100644 --- a/whatsapp_mail_messaging/model/account_move.py +++ b/whatsapp_mail_messaging/model/account_move.py @@ -32,9 +32,11 @@ class Account(models.Model): 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..e06adc83a --- /dev/null +++ b/whatsapp_mail_messaging/model/res_company.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-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..0082b023d --- /dev/null +++ b/whatsapp_mail_messaging/model/res_config_settings.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2021-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..ea5705061 100644 --- a/whatsapp_mail_messaging/model/sale_order.py +++ b/whatsapp_mail_messaging/model/sale_order.py @@ -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/selection_messages.py b/whatsapp_mail_messaging/model/selection_messages.py deleted file mode 100644 index 05b651f8d..000000000 --- a/whatsapp_mail_messaging/model/selection_messages.py +++ /dev/null @@ -1,9 +0,0 @@ -from odoo import fields, models - - -class SelectionMessages(models.Model): - _name = 'selection.messages' - - name = fields.Char(string='Name of the Message Template') - message = fields.Text(string="Message", required=True) - diff --git a/whatsapp_mail_messaging/security/ir.model.access.csv b/whatsapp_mail_messaging/security/ir.model.access.csv index 76432c689..245c7ddc6 100644 --- a/whatsapp_mail_messaging/security/ir.model.access.csv +++ b/whatsapp_mail_messaging/security/ir.model.access.csv @@ -1,4 +1,2 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_whatsapp_message_wizard,access.whatsapp.message.wizard,model_whatsapp_message_wizard,base.group_user,1,1,1,1 -access_selection_messages,access.selection.messages,model_selection_messages,base.group_user,1,1,1,1 - diff --git a/whatsapp_mail_messaging/static/description/assets/screenshots/23.png b/whatsapp_mail_messaging/static/description/assets/screenshots/23.png new file mode 100644 index 000000000..8b36d2449 Binary files /dev/null and b/whatsapp_mail_messaging/static/description/assets/screenshots/23.png differ diff --git a/whatsapp_mail_messaging/static/description/index.html b/whatsapp_mail_messaging/static/description/index.html index bdfdb7c2b..93233b539 100644 --- a/whatsapp_mail_messaging/static/description/index.html +++ b/whatsapp_mail_messaging/static/description/index.html @@ -242,7 +242,11 @@

The message will redirect to the whatsapp web with the details in the popup.

- +
+

Whatsapp Message Template

+

Create whatsapp message template for sales orders and invoices.

+ +

Add Mobile in Website

In the website form view we can define the number along with country code required for communicating diff --git a/whatsapp_mail_messaging/views/account_move_inherited.xml b/whatsapp_mail_messaging/views/account_move_inherited.xml index 0b745582e..89883a109 100644 --- a/whatsapp_mail_messaging/views/account_move_inherited.xml +++ b/whatsapp_mail_messaging/views/account_move_inherited.xml @@ -22,4 +22,4 @@ - \ No newline at end of file + 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..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/views/selection_messages_views.xml b/whatsapp_mail_messaging/views/selection_messages_views.xml deleted file mode 100644 index 3d6291d6e..000000000 --- a/whatsapp_mail_messaging/views/selection_messages_views.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - selection.messages.view.tree - selection.messages - - - - - - - - - - selection.messages.view.form - selection.messages - -
- - - - - - - - - - - - - - -
-
-
- - - Selection Messages - selection.messages - ir.actions.act_window - tree,form - - - - -
diff --git a/whatsapp_mail_messaging/wizard/wh_message_wizard.py b/whatsapp_mail_messaging/wizard/wh_message_wizard.py index 071ebab47..3910b7b7d 100644 --- a/whatsapp_mail_messaging/wizard/wh_message_wizard.py +++ b/whatsapp_mail_messaging/wizard/wh_message_wizard.py @@ -28,8 +28,6 @@ class WhatsappSendMessage(models.TransientModel): partner_id = fields.Many2one('res.partner', string="Recipient") mobile = fields.Char(required=True, string="Contact Number") message = fields.Text(string="Message", required=True) - message_name_id = fields.Many2one('selection.messages', string="Message Template") - type_message = fields.Selection([('custom', 'Custom'), ('default', 'Default')], 'Message Type', default='custom') image_1920 = fields.Binary(readonly=1) @api.onchange('partner_id') @@ -39,18 +37,6 @@ class WhatsappSendMessage(models.TransientModel): self.mobile = self.partner_id.mobile self.image_1920 = self.partner_id.image_1920 - @api.onchange('message_name_id') - def _onchange_type_message(self): - """Function to set the default message based on type_message""" - if self.message_name_id: - self.message = self.message_name_id.message - - @api.onchange('type_message') - def _onchange_type_message_type(self): - """Function to set the default message based on type_message""" - if self.type_message == 'default': - self.message = self.message_name_id.message - def send_message(self): """In this function we are redirecting to the whatsapp web with required parameters""" @@ -62,7 +48,7 @@ class WhatsappSendMessage(models.TransientModel): message_string = message_string[:(len(message_string) - 3)] message_post_content = message_string if self.partner_id: - self.partner_id.message_post(body=message_post_content) + self.partner_id.message_post(body=message_post_content) return { 'type': 'ir.actions.act_url', 'url': "https://api.whatsapp.com/send?phone=" + self.mobile + "&text=" + message_string, diff --git a/whatsapp_mail_messaging/wizard/wh_message_wizard.xml b/whatsapp_mail_messaging/wizard/wh_message_wizard.xml index f22b5bbba..4ff99c29a 100644 --- a/whatsapp_mail_messaging/wizard/wh_message_wizard.xml +++ b/whatsapp_mail_messaging/wizard/wh_message_wizard.xml @@ -14,24 +14,22 @@ $('.modal-body').css({'height': '100%'}); }); + + - - - - - - + + +