Browse Source

May 20: [FIX] Bug Fixed 'whatsapp_mail_messaging'

pull/164/merge
RisvanaCybro 11 months ago
parent
commit
873ac835ee
  1. 4
      whatsapp_mail_messaging/__manifest__.py
  2. 5
      whatsapp_mail_messaging/doc/changelog.md
  3. 3
      whatsapp_mail_messaging/model/__init__.py
  4. 4
      whatsapp_mail_messaging/model/account_move.py
  5. 32
      whatsapp_mail_messaging/model/res_company.py
  6. 33
      whatsapp_mail_messaging/model/res_config_settings.py
  7. 4
      whatsapp_mail_messaging/model/sale_order.py
  8. BIN
      whatsapp_mail_messaging/static/description/assets/screenshots/whatsapp_mail_messaging_23.png
  9. 27
      whatsapp_mail_messaging/static/description/index.html
  10. 16
      whatsapp_mail_messaging/views/res_company_views.xml
  11. 31
      whatsapp_mail_messaging/views/res_config_settings_views.xml

4
whatsapp_mail_messaging/__manifest__.py

@ -22,7 +22,7 @@
{ {
'name': 'Odoo Whatsapp Connector', 'name': 'Odoo Whatsapp Connector',
'version': '14.0.2.1.2', 'version': '14.0.2.2.2',
'category': 'Extra Tools', 'category': 'Extra Tools',
'summary': """Odoo Whatsapp Connector For Sales, Invoice, and Floating button in Website""", '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, 'description': """Added options for sending Whatsapp messages and Mails in systray bar,sale order, invoices,
@ -39,6 +39,8 @@
'views/sale_order_inherited.xml', 'views/sale_order_inherited.xml',
'views/account_move_inherited.xml', 'views/account_move_inherited.xml',
'views/website_inherited.xml', 'views/website_inherited.xml',
'views/res_company_views.xml',
'views/res_config_settings_views.xml',
'wizard/wh_message_wizard.xml', 'wizard/wh_message_wizard.xml',
'wizard/portal_share_inherited.xml', 'wizard/portal_share_inherited.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',

5
whatsapp_mail_messaging/doc/changelog.md

@ -10,6 +10,11 @@
#### UPDT #### UPDT
- New Features added - New Features added
#### 20.05.2024
#### Version 14.0.2.2.1
#### UPDT
- New Message template Features added.

3
whatsapp_mail_messaging/model/__init__.py

@ -19,7 +19,8 @@
# If not, see <http://www.gnu.org/licenses/>. # If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################# #############################################################################
from . import website from . import website
from . import sale_order from . import sale_order
from . import account_move from . import account_move
from . import res_company
from . import res_config_settings

4
whatsapp_mail_messaging/model/account_move.py

@ -32,9 +32,11 @@ class Account(models.Model):
def action_send_whatsapp(self): def action_send_whatsapp(self):
compose_form_id = self.env.ref('whatsapp_mail_messaging.whatsapp_message_wizard_form').id compose_form_id = self.env.ref('whatsapp_mail_messaging.whatsapp_message_wizard_form').id
ctx = dict(self.env.context) 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' + \ 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 "Please use the following communication for your payment" + ' ' + self.name
message = message_template if message_template else default_message
ctx.update({ ctx.update({
'default_message': message, 'default_message': message,
'default_partner_id': self.partner_id.id, 'default_partner_id': self.partner_id.id,

32
whatsapp_mail_messaging/model/res_company.py

@ -0,0 +1,32 @@
# -*- 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 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")

33
whatsapp_mail_messaging/model/res_config_settings.py

@ -0,0 +1,33 @@
# -*- 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 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)

4
whatsapp_mail_messaging/model/sale_order.py

@ -32,8 +32,10 @@ class Sale(models.Model):
def action_send_whatsapp(self): def action_send_whatsapp(self):
compose_form_id = self.env.ref('whatsapp_mail_messaging.whatsapp_message_wizard_form').id compose_form_id = self.env.ref('whatsapp_mail_messaging.whatsapp_message_wizard_form').id
ctx = dict(self.env.context) 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." 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({ ctx.update({
'default_message': message, 'default_message': message,
'default_partner_id': self.partner_id.id, 'default_partner_id': self.partner_id.id,

BIN
whatsapp_mail_messaging/static/description/assets/screenshots/whatsapp_mail_messaging_23.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

27
whatsapp_mail_messaging/static/description/index.html

@ -59,7 +59,7 @@
<p class="text-center" <p class="text-center"
style="font-family: Montserrat, 'sans-serif'; color: #1a1a1a !important; font-weight: 300 !important; font-size: 1rem !important; margin-bottom: 0 !important;"> style="font-family: Montserrat, 'sans-serif'; color: #1a1a1a !important; font-weight: 300 !important; font-size: 1rem !important; margin-bottom: 0 !important;">
Using this button we can send the order/invoice details to the customer of the Using this button we can send the order/invoice details to the customer of the
corresponding documents.. </p> corresponding documents. </p>
</div> </div>
</div> </div>
<div class="col-lg-6"> <div class="col-lg-6">
@ -257,6 +257,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;"> 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;">
<h6 style="margin-top: 0.6rem; color: #fff !important;">14</h6> <h6 style="margin-top: 0.6rem; color: #fff !important;">14</h6>
</div> </div>
<h6 class="mt-2 ml-2">Create whatsapp message template for sales orders and invoices.</h6>
</div>
<img src="assets/screenshots/whatsapp_mail_messaging_23.png" width="100%" class="img-resposive"
style="border-radius: 10px !important;">
</div>
<div class="col-lg-12" style="background-color: #ffffff !important; padding: 4rem 3rem;">
<div class="d-flex my-3">
<div class="d-flex justify-content-center align-items-center"
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;">
<h6 style="margin-top: 0.6rem; color: #fff !important;">15</h6>
</div>
<h6 class="mt-2 ml-2">In the website form view we can define the number along with country code required for communicating with the <h6 class="mt-2 ml-2">In the website form view we can define the number along with country code required for communicating with the
website responsible.</h6> website responsible.</h6>
</div> </div>
@ -267,7 +278,7 @@
<div class="d-flex my-3"> <div class="d-flex my-3">
<div class="d-flex justify-content-center align-items-center" <div class="d-flex justify-content-center align-items-center"
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;"> 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;">
<h6 style="margin-top: 0.6rem; color: #fff !important;">15</h6> <h6 style="margin-top: 0.6rem; color: #fff !important;">16</h6>
</div> </div>
<h6 class="mt-2 ml-2">There will be a whatsapp icon present in the website.</h6> <h6 class="mt-2 ml-2">There will be a whatsapp icon present in the website.</h6>
</div> </div>
@ -278,7 +289,7 @@
<div class="d-flex my-3"> <div class="d-flex my-3">
<div class="d-flex justify-content-center align-items-center" <div class="d-flex justify-content-center align-items-center"
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;"> 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;">
<h6 style="margin-top: 0.6rem; color: #fff !important;">16</h6> <h6 style="margin-top: 0.6rem; color: #fff !important;">17</h6>
</div> </div>
<h6 class="mt-2 ml-2">By clicking on the whatsapp floating icon it will redirect to whatsapp web with the recipient as the number specified in corresponding website</h6> <h6 class="mt-2 ml-2">By clicking on the whatsapp floating icon it will redirect to whatsapp web with the recipient as the number specified in corresponding website</h6>
</div> </div>
@ -289,7 +300,7 @@
<div class="d-flex my-3"> <div class="d-flex my-3">
<div class="d-flex justify-content-center align-items-center" <div class="d-flex justify-content-center align-items-center"
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;"> 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;">
<h6 style="margin-top: 0.6rem; color: #fff !important;">17</h6> <h6 style="margin-top: 0.6rem; color: #fff !important;">18</h6>
</div> </div>
<h6 class="mt-2 ml-2">We will have a share menu in documents like sales order, invoices, purchase etc..</h6> <h6 class="mt-2 ml-2">We will have a share menu in documents like sales order, invoices, purchase etc..</h6>
</div> </div>
@ -300,7 +311,7 @@
<div class="d-flex my-3"> <div class="d-flex my-3">
<div class="d-flex justify-content-center align-items-center" <div class="d-flex justify-content-center align-items-center"
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;"> 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;">
<h6 style="margin-top: 0.6rem; color: #fff !important;">18</h6> <h6 style="margin-top: 0.6rem; color: #fff !important;">19</h6>
</div> </div>
<h6 class="mt-2 ml-2">By clicking on that there will be an additional option 'Whatsapp" in the popup screen where we can add the customer <h6 class="mt-2 ml-2">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.</h6> and additional contents if we need.</h6>
@ -312,7 +323,7 @@
<div class="d-flex my-3"> <div class="d-flex my-3">
<div class="d-flex justify-content-center align-items-center" <div class="d-flex justify-content-center align-items-center"
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;"> 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;">
<h6 style="margin-top: 0.6rem; color: #fff !important;">19</h6> <h6 style="margin-top: 0.6rem; color: #fff !important;">20</h6>
</div> </div>
<h6 class="mt-2 ml-2">After click on send first it will redirected to then whatsapp web and then to corresponding contact in our whatsapp <h6 class="mt-2 ml-2">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.</h6> along with the custom message and link for accessing the document.</h6>
@ -324,7 +335,7 @@
<div class="d-flex my-3"> <div class="d-flex my-3">
<div class="d-flex justify-content-center align-items-center" <div class="d-flex justify-content-center align-items-center"
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;"> 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;">
<h6 style="margin-top: 0.6rem; color: #fff !important;">19</h6> <h6 style="margin-top: 0.6rem; color: #fff !important;">21</h6>
</div> </div>
<h6 class="mt-2 ml-2">In the sales and invoice list view, we will have an option after selecting the records in the list view.</h6> <h6 class="mt-2 ml-2">In the sales and invoice list view, we will have an option after selecting the records in the list view.</h6>
</div> </div>
@ -335,7 +346,7 @@
<div class="d-flex my-3"> <div class="d-flex my-3">
<div class="d-flex justify-content-center align-items-center" <div class="d-flex justify-content-center align-items-center"
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;"> 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;">
<h6 style="margin-top: 0.6rem; color: #fff !important;">19</h6> <h6 style="margin-top: 0.6rem; color: #fff !important;">22</h6>
</div> </div>
<h6 class="mt-2 ml-2">We can send multiple document references to a single customer using this option, <h6 class="mt-2 ml-2">We can send multiple document references to a single customer using this option,
we can only send documents of a single customer at a time.</h6> we can only send documents of a single customer at a time.</h6>

16
whatsapp_mail_messaging/views/res_company_views.xml

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="res_company_view_form" model="ir.ui.view">
<field name="name">
res.company.view.form.inherit.whatsapp.mail.messaging
</field>
<field name="model">res.company</field>
<field name="inherit_id"
ref="base.view_company_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='country_id']" position="after">
<field name="whatsapp_message" invisible="1"/>
</xpath>
</field>
</record>
</odoo>

31
whatsapp_mail_messaging/views/res_config_settings_views.xml

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">
res.config.settings.view.form.inherit.whatsapp.mail.messaging
</field>
<field name="model">res.config.settings</field>
<field name="inherit_id"
ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='integration']" position="after">
<h2>Whatsapp</h2>
<div class="row mt16 o_settings_container" name="whatsapp_message">
<div class="col-12 col-lg-6 o_setting_box" id="whatsapp_message_tempalte">
<label for="whatsapp_message"/>
<field name="whatsapp_message" placeholder="Message..." widget="text_emojis"/>
<div class="text-muted">
This WhatsApp message template is for sales orders and invoices.
</div>
</div>
</div>
<!-- <block title="Whatsapp" id="whatsapp_message">-->
<!-- <setting-->
<!-- help="This WhatsApp message template is for sales orders and invoices.">-->
<!-- <field name="whatsapp_message" placeholder="Message..." widget="text_emojis"/>-->
<!-- </setting>-->
<!-- </block>-->
</xpath>
</field>
</record>
</odoo>
Loading…
Cancel
Save