Port mail_usability to v10

This commit is contained in:
Alexis de Lattre
2016-12-02 19:44:56 +01:00
committed by Chafique
parent a7a68e8dee
commit d3cb8aeb79
4 changed files with 29 additions and 98 deletions

View File

@@ -1,23 +1 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Mail Usability module for Odoo
# Copyright (C) 2016 Akretion (http://www.akretion.com)
# @author Benoît Guillot <benoit.guillot@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import mail

View File

@@ -1,29 +1,12 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Mail Usability module for Odoo
# Copyright (C) 2016 Akretion (http://www.akretion.com)
# @author Benoît Guillot <benoit.guillot@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2016 Akretion (http://www.akretion.com)
# @author Benoît Guillot <benoit.guillot@akretion.com>
# @author Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Mail Usability',
'version': '0.1',
'version': '10.0.1.0.0',
'category': 'Base',
'license': 'AGPL-3',
'summary': 'Usability improvements on mails',
@@ -41,6 +24,6 @@ Small usability improvements on mails:
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['mail'],
'data': [],
'installable': False,
'data': ['mail_view.xml'],
'installable': True,
}

View File

@@ -1,52 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Mail Usability module for Odoo
# Copyright (C) 2016 Akretion (http://www.akretion.com)
# @author Benoît Guillot <benoit.guillot@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# 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 Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, api
class MailMail(models.Model):
_inherit = 'mail.mail'
@api.model
def send_get_mail_body(self, mail, partner=None):
"""
Avoid unwanted links in mail footer.
"""
return mail.body_html
class MailNotification(models.Model):
_inherit = 'mail.notification'
@api.cr_uid_id_context
def get_signature_footer(
self, cr, uid, user_id, res_model=None, res_id=None, context=None,
user_signature=True):
"""
Remove : "Sent by 'Your Company' using Odoo" from signature.
"""
footer = super(MailNotification, self).get_signature_footer(
cr, uid, user_id, res_model=res_model, res_id=res_id,
context=context, user_signature=user_signature)
footer = footer[:footer.find('\n\n<br /><small>Sent by ')]
footer = footer[:footer.find(u'\n\n<br /><small>Envoyé par ')]
return footer

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_mail_tree" model="ir.ui.view">
<field name="name">mail_usability.mail.tree</field>
<field name="model">mail.mail</field>
<field name="inherit_id" ref="mail.view_mail_tree"/>
<field name="arch" type="xml">
<field name="email_from" position="replace"/>
<field name="date" position="after">
<field name="email_from"/>
<field name="email_to"/>
</field>
</field>
</record>
</odoo>