Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] 17.0 - smile_partner_mail_history - from Inafon migration #133

Open
wants to merge 1 commit into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions smile_partner_mail_history/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
===========================
Smile Partner Mail History
===========================

.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-Smile_SA%2Fodoo_addons-lightgray.png?logo=github
:target: https://github.com/Smile-SA/odoo_addons/tree/13.0/smile_partner_mail_history
:alt: Smile-SA/odoo_addons

|badge2| |badge3|

This module allows you to consult all partner's received messages (Emails, Chatter Notifications ...) through his form view.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Go to a partner `Form` view and click on smart button `History`.

.. figure:: static/description/partner_form.png
:alt: Import
:width: 100%

2. You will be redirected to partner's received messages.

.. figure:: static/description/messages.png
:alt: Import
:width: 100%

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/Smile-SA/odoo_addons/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback
`here <https://github.com/Smile-SA/odoo_addons/issues/new?body=module:%20smile_partner_mail_history%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

GDPR / EU Privacy
=================

This addons does not collect any data and does not set any browser cookies.

Credits
=======

Authors
~~~~~~~

* Smile SA

Contributors
~~~~~~~~~~~~

* Isabelle RICHARD
* Seif Iddine HAMMAMI

Maintainers
~~~~~~~~~~~

This module is maintained by the Smile SA.

Since 1991 Smile has been a pioneer of technology and also the European expert in open source solutions.

.. image:: https://avatars0.githubusercontent.com/u/572339?s=200&v=4
:alt: Smile SA
:target: http://smile.fr

This module is part of the `odoo-addons <https://github.com/Smile-SA/odoo_addons>`_ project on GitHub.

You are welcome to contribute.
5 changes: 5 additions & 0 deletions smile_partner_mail_history/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# (C) 2020 Smile (<http://www.smile.fr>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import models
39 changes: 39 additions & 0 deletions smile_partner_mail_history/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
# (C) 2020 Smile (<http://www.smile.fr>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Smile Partner Mail History",
"version": "17.0.0.1.0",
"depends": [
"web",
"mail",
],
"author": "Smile",
"license": 'AGPL-3',
"description": "Consult Received Emails From Partner Form",
"summary": "",
"website": "",
"category": "Discuss",
"data": [
# Security
# Data
# Reports
# Views
'views/mail_message_views.xml',
'views/res_partner_views.xml',
# Wizard
],
"demo": [
],
"qweb": [
],
"assets": {
"web.assets_backend": [
'smile_partner_mail_history/static/src/scss/partner_mail_history.scss',
],
},
"auto_install": False,
"installable": True,
"application": True,
}
58 changes: 58 additions & 0 deletions smile_partner_mail_history/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * smile_partner_mail_history
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-08-06 15:15+0000\n"
"PO-Revision-Date: 2020-08-06 15:15+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: smile_partner_mail_history
#: model_terms:ir.ui.view,arch_db:smile_partner_mail_history.view_message_form_partner_mail_history
msgid "Body"
msgstr "Corps"

#. module: smile_partner_mail_history
#: model:ir.model,name:smile_partner_mail_history.model_res_partner
msgid "Contact"
msgstr "Contact"

#. module: smile_partner_mail_history
#: model_terms:ir.ui.view,arch_db:smile_partner_mail_history.view_partner_form
msgid "History"
msgstr "Historique"

#. module: smile_partner_mail_history
#: model_terms:ir.ui.view,arch_db:smile_partner_mail_history.view_message_form_partner_mail_history
msgid "Message"
msgstr ""

#. module: smile_partner_mail_history
#: model_terms:ir.ui.view,arch_db:smile_partner_mail_history.view_message_tree_partner_mail_history
msgid "Messages"
msgstr ""

#. module: smile_partner_mail_history
#: model:ir.model.fields,field_description:smile_partner_mail_history.field_res_partner__messages_count
#: model:ir.model.fields,field_description:smile_partner_mail_history.field_res_users__messages_count
msgid "Messages Count"
msgstr "Nombre de messages"

#. module: smile_partner_mail_history
#: model_terms:ir.ui.view,arch_db:smile_partner_mail_history.view_message_form_partner_mail_history
msgid "Recipients"
msgstr "Destinataires"

#. module: smile_partner_mail_history
#: code:addons/smile_partner_mail_history/models/res_partner.py:0
#, python-format
msgid "This partner %s does not have any messages history!"
msgstr "Ce partenaire %s n'a pas d'historique de messages !"
5 changes: 5 additions & 0 deletions smile_partner_mail_history/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# (C) 2020 Smile (<http://www.smile.fr>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import res_partner
45 changes: 45 additions & 0 deletions smile_partner_mail_history/models/res_partner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-
# (C) 2020 Smile (<http://www.smile.fr>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


from odoo import fields, models, _

MAIL_MESSAGE_TYPES = ('email', 'comment', 'notification', 'user_notification')


class ResPartner(models.Model):
_inherit = 'res.partner'

messages_count = fields.Integer(compute='_compute_messages_count')

def _compute_messages_count(self):
Message = self.env['mail.message']
for partner in self:
partner.messages_count = Message.search_count([
('message_type', 'in', MAIL_MESSAGE_TYPES),
('partner_ids', 'in', partner.id),
])

def action_received_email_history(self):
"""
Show all received mail.message for a specific partner
"""
self.ensure_one()
action = self.env.ref('mail.action_view_mail_message')
result = action.read()[0]
result['views'] = [
(self.env.ref(
'smile_partner_mail_history.'
'view_message_tree_partner_mail_history').id,
'tree'),
(self.env.ref(
'smile_partner_mail_history.'
'view_message_form_partner_mail_history').id,
'form'),
]
result['domain'] = [
('message_type', 'in', MAIL_MESSAGE_TYPES),
('partner_ids', 'in', self.ids)
]
return result
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading