From 7a32b0872cde77d4c0095c922507a700bedbab28 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Fri, 18 Mar 2016 18:03:32 +0100 Subject: [PATCH] [ADD] Add mail_optional_autofollow module --- mail_optional_autofollow/README.rst | 60 ++++++++++++++++++ mail_optional_autofollow/__init__.py | 4 ++ mail_optional_autofollow/__openerp__.py | 22 +++++++ .../static/description/autofollow.png | Bin 0 -> 15854 bytes .../static/description/icon.png | Bin 0 -> 9455 bytes mail_optional_autofollow/tests/__init__.py | 5 ++ .../tests/test_mail_optional_autofollow.py | 45 +++++++++++++ mail_optional_autofollow/wizard/__init__.py | 4 ++ .../wizard/mail_compose_message.py | 28 ++++++++ .../wizard/mail_compose_message_view.xml | 15 +++++ 10 files changed, 183 insertions(+) create mode 100644 mail_optional_autofollow/README.rst create mode 100644 mail_optional_autofollow/__init__.py create mode 100644 mail_optional_autofollow/__openerp__.py create mode 100644 mail_optional_autofollow/static/description/autofollow.png create mode 100644 mail_optional_autofollow/static/description/icon.png create mode 100644 mail_optional_autofollow/tests/__init__.py create mode 100644 mail_optional_autofollow/tests/test_mail_optional_autofollow.py create mode 100644 mail_optional_autofollow/wizard/__init__.py create mode 100644 mail_optional_autofollow/wizard/mail_compose_message.py create mode 100644 mail_optional_autofollow/wizard/mail_compose_message_view.xml diff --git a/mail_optional_autofollow/README.rst b/mail_optional_autofollow/README.rst new file mode 100644 index 00000000..3223d748 --- /dev/null +++ b/mail_optional_autofollow/README.rst @@ -0,0 +1,60 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +======================== +Mail optional autofollow +======================== + +This module adds the possibility to choose if you want to automatically +add new recipients as followers on mail.compose.message. + +Usage +===== + +To use this module, you need to use the autofollow recipients checkbox on mail.compose.message: + +Technically, this field it's initialized to true if there is an +'mail_post_autofollow' key in the current context + +.. figure:: static/description/autofollow.png + :alt: autofollow recipients checkbox + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/205/8.0 + +For further information, please visit: + + * https://www.odoo.com/forum/help-1 + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Credits +======= + +Contributors +------------ + +* Adrien Peiffer +* Stéphane Bidoul + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file diff --git a/mail_optional_autofollow/__init__.py b/mail_optional_autofollow/__init__.py new file mode 100644 index 00000000..09571272 --- /dev/null +++ b/mail_optional_autofollow/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import wizard diff --git a/mail_optional_autofollow/__openerp__.py b/mail_optional_autofollow/__openerp__.py new file mode 100644 index 00000000..a34fc6af --- /dev/null +++ b/mail_optional_autofollow/__openerp__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + 'name': "Mail optional autofollow", + + 'summary': """ + Choose if you want to automatically add new recipients as followers + on mail.compose.message""", + 'author': 'ACSONE SA/NV,' + 'Odoo Community Association (OCA)', + 'website': "http://acsone.eu", + 'category': 'Social Network', + 'version': '8.0.1.0.0', + 'license': 'AGPL-3', + 'depends': [ + 'mail', + ], + 'data': [ + 'wizard/mail_compose_message_view.xml', + ], +} diff --git a/mail_optional_autofollow/static/description/autofollow.png b/mail_optional_autofollow/static/description/autofollow.png new file m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B*=6PBiltMK=0JVIf~?9Y`_y^~8cseC?NPt{06t|tR%Frr{RIdPyE-~{x3|qW z$mZd|p`IQA0Re)4>I{?&=72avN3Z`X?c+!YQ>H_KJ`q{zqD&WJzdoUT5C0+ICm>zJ zDgzY_V68y*3Jmo+2zh`>gp*_t%I6mrjLpr-Nl6*P+8~02eEFheo4y3+96?ak4Jxak zAbf$?^@W9RAo+@h#ROftuC8tvi}n*vPKZeb5L+QrA&IWp_tny~4#p85tRKuH&VFbcm;ZM9cu}EEz#q{~tvA zaP3w%EQ_d!2ux#SbhPu^9x*Hm14Xmc1(+5%A`ZF4M#sU64M(^rZ z`EY7i^P)b*_<8-h`r??rsj16s>m8_lFUHZeEu&M13-2&CH2!lA^8cwd{%>J9asCh0 WW8>BeS&e%aH;N0(2xTE&z5icX8WuVL literal 0 HcmV?d00001 diff --git a/mail_optional_autofollow/static/description/icon.png b/mail_optional_autofollow/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&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H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/mail_optional_autofollow/tests/__init__.py b/mail_optional_autofollow/tests/__init__.py new file mode 100644 index 00000000..3667d24b --- /dev/null +++ b/mail_optional_autofollow/tests/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_mail_optional_autofollow diff --git a/mail_optional_autofollow/tests/test_mail_optional_autofollow.py b/mail_optional_autofollow/tests/test_mail_optional_autofollow.py new file mode 100644 index 00000000..953c1a31 --- /dev/null +++ b/mail_optional_autofollow/tests/test_mail_optional_autofollow.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp.tests import common + + +class TestAttachExistingAttachment(common.TransactionCase): + + def setUp(self): + super(TestAttachExistingAttachment, self).setUp() + self.partner_obj = self.env['res.partner'] + self.partner_01 = self.env.ref('base.res_partner_11') + self.partner_02 = self.env.ref('base.res_partner_address_20') + + def test_send_email_attachment(self): + ctx = self.env.context.copy() + ctx.update({ + 'default_model': 'res.partner', + 'default_res_id': self.partner_01.id, + 'default_composition_mode': 'comment', + }) + mail_compose = self.env['mail.compose.message'] + values = mail_compose.with_context(ctx)\ + .onchange_template_id(False, 'comment', 'res.partner', + self.partner_01.id)['value'] + values['partner_ids'] = [(4, self.partner_02.id)] + compose_id = mail_compose.with_context(ctx).create(values) + compose_id.autofollow_recipients = False + compose_id.with_context(ctx).send_mail() + res = self.env["mail.followers"].search( + [('res_model', '=', 'res.partner'), + ('res_id', '=', self.partner_01.id), + ('partner_id', '=', self.partner_02.id)]) + # I check if the recipient isn't a follower + self.assertEqual(len(res.ids), 0) + compose_id = mail_compose.with_context(ctx).create(values) + compose_id.autofollow_recipients = True + compose_id.with_context(ctx).send_mail() + res = self.env["mail.followers"].search( + [('res_model', '=', 'res.partner'), + ('res_id', '=', self.partner_01.id), + ('partner_id', '=', self.partner_02.id)]) + # I check if the recipient is a follower + self.assertEqual(len(res.ids), 1) diff --git a/mail_optional_autofollow/wizard/__init__.py b/mail_optional_autofollow/wizard/__init__.py new file mode 100644 index 00000000..c82500c9 --- /dev/null +++ b/mail_optional_autofollow/wizard/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import mail_compose_message diff --git a/mail_optional_autofollow/wizard/mail_compose_message.py b/mail_optional_autofollow/wizard/mail_compose_message.py new file mode 100644 index 00000000..a36b6b03 --- /dev/null +++ b/mail_optional_autofollow/wizard/mail_compose_message.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 ACSONE SA/NV () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp import models, fields, api + + +class MailComposeMessage(models.TransientModel): + _inherit = 'mail.compose.message' + + @api.model + def default_get(self, fields_list): + res = super(MailComposeMessage, self).default_get(fields_list) + if self.env.context.get('mail_post_autofollow'): + res['autofollow_recipients'] = True + return res + + autofollow_recipients = fields.Boolean() + + @api.multi + def send_mail(self): + for wizard in self: + if wizard.autofollow_recipients: + wizard = wizard.with_context(mail_post_autofollow=True) + else: + wizard = wizard.with_context(mail_post_autofollow=False) + super(MailComposeMessage, wizard).send_mail() + return {'type': 'ir.actions.act_window_close'} diff --git a/mail_optional_autofollow/wizard/mail_compose_message_view.xml b/mail_optional_autofollow/wizard/mail_compose_message_view.xml new file mode 100644 index 00000000..0bb7eacb --- /dev/null +++ b/mail_optional_autofollow/wizard/mail_compose_message_view.xml @@ -0,0 +1,15 @@ + + + + + mail.compose.message.form (mail_optional_autofollow) + mail.compose.message + + + + + + + + + \ No newline at end of file