@ -0,0 +1,51 @@ |
|||
.. image:: https://img.shields.io/badge/license-LGPL--1-green.svg |
|||
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: LGPL-3 |
|||
|
|||
Partner Email and SMS History |
|||
============================= |
|||
This module developed to record partner sms and email history . |
|||
|
|||
Configuration |
|||
============= |
|||
* No additional configuration needed.. |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
GNU GENERAL PUBLIC LICENSE, Version 3 (LGPLv3) |
|||
(http://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
|||
|
|||
Credits |
|||
------- |
|||
* Developer: (V13) Vinaya S B, |
|||
(V14) Minhaj T, |
|||
(V16) Neenu Merlin Jose, |
|||
(V17) Gayathri V, |
|||
(V18) Ayana KP, |
|||
Contact : odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ayana KP (odoo@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 . import models |
@ -0,0 +1,43 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ayana KP (odoo@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/>. |
|||
# |
|||
############################################################################# |
|||
{ |
|||
'name': "Partner Email and SMS History", |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Extra Tools', |
|||
'summary': """Send/Received Emails and SMS History From Partner Form""", |
|||
'description': "This module Provides Email History in Partner form, it " |
|||
"will also provides SMS History in Partner form.", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': "https://www.cybrosys.com", |
|||
'depends': ['contacts', 'sms'], |
|||
'data': [ |
|||
'views/res_config_settings_views.xml', |
|||
'views/res_partner_views.xml' |
|||
], |
|||
'images': ['static/description/banner.png'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,7 @@ |
|||
## Module <partner_emails_history> |
|||
|
|||
#### 03.10.2024 |
|||
#### Version 18.0.1.0.0 |
|||
#### ADD |
|||
|
|||
- Initial commit for Partner Email and SMS History |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ayana KP (odoo@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 . import res_config_settings |
|||
from . import res_partner |
@ -0,0 +1,49 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ayana KP (odoo@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 api, fields, models |
|||
|
|||
|
|||
class ResConfigSettings(models.TransientModel): |
|||
"""This is used to add new configuration set up for partner email |
|||
history.""" |
|||
_inherit = 'res.config.settings' |
|||
|
|||
is_history = fields.Boolean(string="Show history", |
|||
help="If enabled, it will Show History", |
|||
config_parameter='partner_emails_history' |
|||
'.default_is_history') |
|||
is_sms_history = fields.Boolean(string="Show Sms history", |
|||
help="If enabled it will Show sms history", |
|||
config_parameter='partner_emails_history' |
|||
'.default_is_sms_history') |
|||
is_email_history = fields.Boolean(string="Show Email history", |
|||
help="If enabled, it will Show " |
|||
"email history", |
|||
config_parameter='partner_emails_history' |
|||
'.default_is_email_history') |
|||
|
|||
@api.onchange('is_sms_history', 'is_email_history') |
|||
def _onchange_show_history(self): |
|||
"""This is used to add values to the partner form""" |
|||
for rec in self.env['res.partner'].search([]): |
|||
rec.is_show_sms = self.is_sms_history |
|||
rec.is_show_emails = self.is_email_history |
@ -0,0 +1,86 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Ayana KP (odoo@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 ResPartner(models.Model): |
|||
"""This is used to add the email history functionality""" |
|||
_inherit = 'res.partner' |
|||
|
|||
is_show_sms = fields.Boolean(string="Show sms history", |
|||
help="Visibility of sms history", |
|||
config_parameter='partner_emails_history' |
|||
'.default_is_sms_history') |
|||
is_show_emails = fields.Boolean(string="Show email history", |
|||
help="Visibility of email history", |
|||
config_parameter='partner_emails_history' |
|||
'.default_is_email_history') |
|||
sms_count = fields.Integer(string="Sms Count", |
|||
help="Count of total sms of the customer", |
|||
compute="_compute_sms") |
|||
received_email_count = fields.Integer(string="Received Email Count", |
|||
help="Count of total received " |
|||
"emails for the customer", |
|||
compute="_compute_email") |
|||
send_email_count = fields.Integer(string="Send EmailCount", |
|||
help="Count of emails send by the " |
|||
"customer", |
|||
compute="_compute_email") |
|||
|
|||
def _compute_email(self): |
|||
"""This is used to compute the count of emails""" |
|||
for rec in self: |
|||
message_from = rec.env['mail.message'].search( |
|||
[('email_from', 'ilike', self.email)]) |
|||
rec.send_email_count = len(message_from) |
|||
|
|||
message_to = rec.env['mail.message'].search( |
|||
[('partner_ids', 'in', self.id)]) |
|||
rec.received_email_count = len(message_to) |
|||
|
|||
def _compute_sms(self): |
|||
"""This is used to compute the count of sms""" |
|||
for rec in self: |
|||
count = rec.env['sms.sms'].search([('partner_id', '=', rec.id)]) |
|||
rec.sms_count = len(count) |
|||
|
|||
def action_view_partner_sms(self): |
|||
"""This is used to visible the sms of the partner""" |
|||
self.ensure_one() |
|||
action = self.env.ref('sms.sms_sms_action').read()[0] |
|||
action['domain'] = [ |
|||
('partner_id', '=', self.id)] |
|||
return action |
|||
|
|||
def sent_email_history(self): |
|||
"""This is used to visible the send emails of the partner""" |
|||
action = self.env.ref('mail.action_view_mail_message') |
|||
result = action.read()[0] |
|||
result['domain'] = [('email_from', 'ilike', self.email)] |
|||
return result |
|||
|
|||
def received_email_history(self): |
|||
"""This is used to visible the received emails of the partner""" |
|||
action = self.env.ref('mail.action_view_mail_message') |
|||
result = action.read()[0] |
|||
result['domain'] = [('partner_ids', 'in', self.id)] |
|||
return result |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 738 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 912 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 82 KiB |
After Width: | Height: | Size: 160 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 21 KiB |
After Width: | Height: | Size: 130 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,61 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!--Show Partner History--> |
|||
<record id="res_config_settings_view_form" model="ir.ui.view"> |
|||
<field name="name">res.config.settings.view.form.inherit.partner.emails.history</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[@id='contacts_settings']" position="inside"> |
|||
<div class="row mt16 o_settings_container"> |
|||
<div class="col-xs-12 col-md-6 o_setting_box" |
|||
title="Show History" |
|||
id="partner_sms"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="is_history"/> |
|||
</div> |
|||
<div class="o_setting_right_pane" |
|||
id="partner_sms_settings"> |
|||
<label for="is_history"/> |
|||
<div class="text-muted"> |
|||
Show History |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="row mt16 o_settings_container" |
|||
invisible="is_history == False"> |
|||
<div class="col-xs-12 col-md-6 o_setting_box" |
|||
title="Show Sms History" |
|||
id="partner_sms"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="is_sms_history"/> |
|||
</div> |
|||
<div class="o_setting_right_pane" |
|||
id="partner_sms_settings"> |
|||
<label for="is_sms_history"/> |
|||
<div class="text-muted"> |
|||
Show history of sms for each partners |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-xs-12 col-md-6 o_setting_box" |
|||
title="Show Email History" |
|||
id="partner_sms"> |
|||
<div class="o_setting_left_pane"> |
|||
<field name="is_email_history"/> |
|||
</div> |
|||
<div class="o_setting_right_pane" |
|||
id="partner_sms_settings"> |
|||
<label for="is_email_history"/> |
|||
<div class="text-muted"> |
|||
Show history of received and send emails for |
|||
each partners |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,34 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<odoo> |
|||
<!-- This is used to add smart buttons in the partner form--> |
|||
<record id="res_partner_view_form" model="ir.ui.view"> |
|||
<field name="name">res.partner.view.form.inherit.partner.emails.history</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//div[@name='button_box']" position="inside"> |
|||
<button class="oe_stat_button" type="object" |
|||
invisible="is_show_sms == False" |
|||
name="action_view_partner_sms" icon="fa-comments-o"> |
|||
<field name="sms_count" string="SMS" widget="statinfo"/> |
|||
</button> |
|||
<button class="oe_stat_button" type="object" |
|||
invisible="is_show_emails == False" |
|||
name="sent_email_history" icon="fa-mail-forward"> |
|||
<field name="send_email_count" string="Sent Emails" |
|||
widget="statinfo"/> |
|||
</button> |
|||
<button class="oe_stat_button" type="object" |
|||
invisible="is_show_emails == False" |
|||
name="received_email_history" icon="fa-mail-reply"> |
|||
<field name="received_email_count" string="Received Emails" |
|||
widget="statinfo"/> |
|||
</button> |
|||
</xpath> |
|||
<xpath expr="//field[@name='vat']" position="after"> |
|||
<field name="is_show_sms" invisible="1"/> |
|||
<field name="is_show_emails" invisible="1"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |