Browse Source

May 20: [FIX] Bug Fixed 'whatsapp_mail_messaging'

pull/254/merge
RisvanaCybro 11 months ago
parent
commit
9060646c26
  1. 2
      whatsapp_mail_messaging/__init__.py
  2. 6
      whatsapp_mail_messaging/__manifest__.py
  3. 6
      whatsapp_mail_messaging/doc/changelog.md
  4. 5
      whatsapp_mail_messaging/model/__init__.py
  5. 6
      whatsapp_mail_messaging/model/account_move.py
  6. 32
      whatsapp_mail_messaging/model/res_company.py
  7. 33
      whatsapp_mail_messaging/model/res_config_settings.py
  8. 6
      whatsapp_mail_messaging/model/sale_order.py
  9. 2
      whatsapp_mail_messaging/model/website.py
  10. BIN
      whatsapp_mail_messaging/static/description/assets/screenshots/whatsapp_mail_messaging_23.png
  11. 7
      whatsapp_mail_messaging/static/description/index.html
  12. 16
      whatsapp_mail_messaging/views/res_company_views.xml
  13. 31
      whatsapp_mail_messaging/views/res_config_settings_views.xml
  14. 2
      whatsapp_mail_messaging/wizard/__init__.py
  15. 2
      whatsapp_mail_messaging/wizard/portal_share.py
  16. 2
      whatsapp_mail_messaging/wizard/wh_message_wizard.py

2
whatsapp_mail_messaging/__init__.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER

6
whatsapp_mail_messaging/__manifest__.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# 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',

6
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.

5
whatsapp_mail_messaging/model/__init__.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER
@ -19,7 +19,8 @@
# If not, see <http://www.gnu.org/licenses/>.
#
#############################################################################
from . import website
from . import sale_order
from . import account_move
from . import res_company
from . import res_config_settings

6
whatsapp_mail_messaging/model/account_move.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# 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,

32
whatsapp_mail_messaging/model/res_company.py

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
#############################################################################
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<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) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<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)

6
whatsapp_mail_messaging/model/sale_order.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# 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,

2
whatsapp_mail_messaging/model/website.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

7
whatsapp_mail_messaging/static/description/index.html

@ -323,6 +323,13 @@
<img src="assets/screenshots/whatsapp_mail_messaging_14.png" class="img-responsive img-thumbnail border"
width="100%" height="auto" />
</div>
<div class="col-lg-12 my-3">
<h4 class="mt-3"
style="font-family: 'Roboto', sans-serif !important; font-weight: 600 !important; color: #282F33 !important; font-size: 1.3rem !important;">
Create whatsapp message template for sales orders and invoices.</h4>
<img src="assets/screenshots/whatsapp_mail_messaging_23.png" class="img-responsive img-thumbnail border"
width="100%" height="auto" />
</div>
<div class="col-lg-12 my-3">
<h4 class="mt-3"

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>

2
whatsapp_mail_messaging/wizard/__init__.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER

2
whatsapp_mail_messaging/wizard/portal_share.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER

2
whatsapp_mail_messaging/wizard/wh_message_wizard.py

@ -3,7 +3,7 @@
#
# Cybrosys Technologies Pvt. Ltd.
#
# Copyright (C) 2021-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>)
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>)
#
# You can modify it under the terms of the GNU LESSER

Loading…
Cancel
Save