Merge lp:~vauxoo/addons-vauxoo/7.0-addons-vauxoo-send_author_email into lp:addons-vauxoo/7.0

Proposed by Julio Serna-http://www.vauxoo.com
Status: Merged
Merged at revision: 998
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-addons-vauxoo-send_author_email
Merge into: lp:addons-vauxoo/7.0
Diff against target: 216 lines (+184/-0)
6 files modified
send_author_mail/__init__.py (+24/-0)
send_author_mail/__openerp__.py (+40/-0)
send_author_mail/model/__init__.py (+25/-0)
send_author_mail/model/mail_notification.py (+44/-0)
send_author_mail/model/res_partner.py (+35/-0)
send_author_mail/view/partner_view.xml (+16/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-addons-vauxoo-send_author_email
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Approve
Julio Serna-http://www.vauxoo.com Pending
Review via email: mp+214849@code.launchpad.net

Description of the change

Add field to allow receive your own email sent

To post a comment you must log in.
1000. By Julio Serna-http://www.vauxoo.com

[IMP] validation when partner have notification_send_mail == all

Revision history for this message
Moisés López - http://www.vauxoo.com (moylop260) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'send_author_mail'
2=== added file 'send_author_mail/__init__.py'
3--- send_author_mail/__init__.py 1970-01-01 00:00:00 +0000
4+++ send_author_mail/__init__.py 2014-04-09 18:56:29 +0000
5@@ -0,0 +1,24 @@
6+#!/usr/bin/python
7+# -*- encoding: utf-8 -*-
8+###########################################################################
9+# Module Writen to OpenERP, Open Source Management Solution
10+# Copyright (C) 2013 Vauxoo (<http://vauxoo.com>).
11+# All Rights Reserved
12+###############Credits######################################################
13+# Coded by: vauxoo consultores (info@vauxoo.com)
14+#############################################################################
15+# This program is free software: you can redistribute it and/or modify
16+# it under the terms of the GNU Affero General Public License as published by
17+# the Free Software Foundation, either version 3 of the License, or
18+# (at your option) any later version.
19+#
20+# This program is distributed in the hope that it will be useful,
21+# but WITHOUT ANY WARRANTY; without even the implied warranty of
22+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23+# GNU Affero General Public License for more details.
24+#
25+# You should have received a copy of the GNU Affero General Public License
26+# along with this program. If not, see <http://www.gnu.org/licenses/>.
27+################################################################################
28+
29+import model
30
31=== added file 'send_author_mail/__openerp__.py'
32--- send_author_mail/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ send_author_mail/__openerp__.py 2014-04-09 18:56:29 +0000
34@@ -0,0 +1,40 @@
35+#!/usr/bin/python
36+# -*- encoding: utf-8 -*-
37+###########################################################################
38+# Module Writen to OpenERP, Open Source Management Solution
39+# Copyright (C) 2013 Vauxoo (<http://vauxoo.com>).
40+# All Rights Reserved
41+###############Credits######################################################
42+# Coded by: vauxoo consultores (info@vauxoo.com)
43+#############################################################################
44+# This program is free software: you can redistribute it and/or modify
45+# it under the terms of the GNU Affero General Public License as published by
46+# the Free Software Foundation, either version 3 of the License, or
47+# (at your option) any later version.
48+#
49+# This program is distributed in the hope that it will be useful,
50+# but WITHOUT ANY WARRANTY; without even the implied warranty of
51+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
52+# GNU Affero General Public License for more details.
53+#
54+# You should have received a copy of the GNU Affero General Public License
55+# along with this program. If not, see <http://www.gnu.org/licenses/>.
56+################################################################################
57+{
58+ 'name' : 'Send Email Author',
59+ 'version' : '1.1',
60+ "website": "http://vauxoo.com",
61+ "category": "Addons Vauxoo",
62+ 'author' : 'Vauxoo',
63+ 'description' : """
64+Check Field receive_my_emails in partner to receive your own copy of messages sent
65+ """,
66+ 'depends' : ['mail'],
67+ 'data': [
68+ 'view/partner_view.xml',
69+ ],
70+ "active": False,
71+ "installable": True,
72+}
73+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
74+
75
76=== added directory 'send_author_mail/model'
77=== added file 'send_author_mail/model/__init__.py'
78--- send_author_mail/model/__init__.py 1970-01-01 00:00:00 +0000
79+++ send_author_mail/model/__init__.py 2014-04-09 18:56:29 +0000
80@@ -0,0 +1,25 @@
81+#!/usr/bin/python
82+# -*- encoding: utf-8 -*-
83+###########################################################################
84+# Module Writen to OpenERP, Open Source Management Solution
85+# Copyright (C) 2013 Vauxoo (<http://vauxoo.com>).
86+# All Rights Reserved
87+###############Credits######################################################
88+# Coded by: vauxoo consultores (info@vauxoo.com)
89+#############################################################################
90+# This program is free software: you can redistribute it and/or modify
91+# it under the terms of the GNU Affero General Public License as published by
92+# the Free Software Foundation, either version 3 of the License, or
93+# (at your option) any later version.
94+#
95+# This program is distributed in the hope that it will be useful,
96+# but WITHOUT ANY WARRANTY; without even the implied warranty of
97+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98+# GNU Affero General Public License for more details.
99+#
100+# You should have received a copy of the GNU Affero General Public License
101+# along with this program. If not, see <http://www.gnu.org/licenses/>.
102+################################################################################
103+
104+import mail_notification
105+import res_partner
106
107=== added file 'send_author_mail/model/mail_notification.py'
108--- send_author_mail/model/mail_notification.py 1970-01-01 00:00:00 +0000
109+++ send_author_mail/model/mail_notification.py 2014-04-09 18:56:29 +0000
110@@ -0,0 +1,44 @@
111+#!/usr/bin/python
112+# -*- encoding: utf-8 -*-
113+###########################################################################
114+# Module Writen to OpenERP, Open Source Management Solution
115+# Copyright (C) 2013 Vauxoo (<http://vauxoo.com>).
116+# All Rights Reserved
117+###############Credits######################################################
118+# Coded by: vauxoo consultores (info@vauxoo.com)
119+#############################################################################
120+# This program is free software: you can redistribute it and/or modify
121+# it under the terms of the GNU Affero General Public License as published by
122+# the Free Software Foundation, either version 3 of the License, or
123+# (at your option) any later version.
124+#
125+# This program is distributed in the hope that it will be useful,
126+# but WITHOUT ANY WARRANTY; without even the implied warranty of
127+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
128+# GNU Affero General Public License for more details.
129+#
130+# You should have received a copy of the GNU Affero General Public License
131+# along with this program. If not, see <http://www.gnu.org/licenses/>.
132+################################################################################
133+
134+
135+from openerp.osv import osv, fields
136+
137+class mail_notification(osv.Model):
138+
139+ _inherit = 'mail.notification'
140+
141+ def get_partners_to_notify(self, cr, uid, message, partners_to_notify=None, context=None):
142+ res = super(mail_notification,
143+ self).get_partners_to_notify(cr, uid,
144+ message,
145+ partners_to_notify=partners_to_notify,
146+ context=context)
147+ if message.author_id and\
148+ (message.author_id.receive_my_emails and\
149+ message.author_id.notification_email_send == "all"):
150+ res.append(message.author_id.id)
151+ return res
152+
153+
154+
155
156=== added file 'send_author_mail/model/res_partner.py'
157--- send_author_mail/model/res_partner.py 1970-01-01 00:00:00 +0000
158+++ send_author_mail/model/res_partner.py 2014-04-09 18:56:29 +0000
159@@ -0,0 +1,35 @@
160+#!/usr/bin/python
161+# -*- encoding: utf-8 -*-
162+###########################################################################
163+# Module Writen to OpenERP, Open Source Management Solution
164+# Copyright (C) 2013 Vauxoo (<http://vauxoo.com>).
165+# All Rights Reserved
166+###############Credits######################################################
167+# Coded by: vauxoo consultores (info@vauxoo.com)
168+#############################################################################
169+# This program is free software: you can redistribute it and/or modify
170+# it under the terms of the GNU Affero General Public License as published by
171+# the Free Software Foundation, either version 3 of the License, or
172+# (at your option) any later version.
173+#
174+# This program is distributed in the hope that it will be useful,
175+# but WITHOUT ANY WARRANTY; without even the implied warranty of
176+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
177+# GNU Affero General Public License for more details.
178+#
179+# You should have received a copy of the GNU Affero General Public License
180+# along with this program. If not, see <http://www.gnu.org/licenses/>.
181+################################################################################
182+
183+
184+from openerp.osv import osv, fields
185+
186+
187+class res_partner(osv.Model):
188+
189+ _inherit = 'res.partner'
190+
191+ _columns = {
192+ 'receive_my_emails': fields.boolean('receive your own email?',
193+ help="receives its own messages if you have enabled this option")
194+ }
195
196=== added directory 'send_author_mail/view'
197=== added file 'send_author_mail/view/partner_view.xml'
198--- send_author_mail/view/partner_view.xml 1970-01-01 00:00:00 +0000
199+++ send_author_mail/view/partner_view.xml 2014-04-09 18:56:29 +0000
200@@ -0,0 +1,16 @@
201+<?xml version="1.0" encoding="utf-8"?>
202+<openerp>
203+ <data>
204+
205+ <record model="ir.ui.view" id="res_partner_receive_email_form">
206+ <field name="name">res.partner.receive.email.form</field>
207+ <field name="model">res.partner</field>
208+ <field name="inherit_id" ref="base.view_partner_form"/>
209+ <field name="arch" type="xml">
210+ <xpath expr="//field[@name='active']" position="after">
211+ <field name="receive_my_emails"/>
212+ </xpath>
213+ </field>
214+ </record>
215+ </data>
216+</openerp>