Merge lp:~vauxoo/addons-vauxoo/7.0-addons-vauxoo-email_template_comment-dev-julio into lp:addons-vauxoo/7.0

Proposed by Julio Serna-http://www.vauxoo.com
Status: Merged
Merged at revision: 1113
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-addons-vauxoo-email_template_comment-dev-julio
Merge into: lp:addons-vauxoo/7.0
Diff against target: 221 lines (+189/-0)
6 files modified
email_template_comment/__init__.py (+24/-0)
email_template_comment/__openerp__.py (+43/-0)
email_template_comment/model/__init__.py (+25/-0)
email_template_comment/model/email_template.py (+35/-0)
email_template_comment/model/mail_compose_message.py (+45/-0)
email_template_comment/view/email_template_view.xml (+17/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-addons-vauxoo-email_template_comment-dev-julio
Reviewer Review Type Date Requested Status
Moisés López - http://www.vauxoo.com Pending
Review via email: mp+230550@code.launchpad.net

Description of the change

Added field in email_template to generated wizard of mail.compose.message like composition_mode = comment

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

[REF] changed label of fields composition_mode_comment in email_template

1113. By Julio Serna-http://www.vauxoo.com

[MERGE]

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'email_template_comment'
2=== added file 'email_template_comment/__init__.py'
3--- email_template_comment/__init__.py 1970-01-01 00:00:00 +0000
4+++ email_template_comment/__init__.py 2014-08-14 16:01:11 +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 'email_template_comment/__openerp__.py'
32--- email_template_comment/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ email_template_comment/__openerp__.py 2014-08-14 16:01:11 +0000
34@@ -0,0 +1,43 @@
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' : 'Email template Comment',
59+ 'version' : '1.1',
60+ "website": "http://vauxoo.com",
61+ "category": "Addons Vauxoo",
62+ 'author' : 'Vauxoo',
63+ 'description' : """
64+Composition mode in email_template
65+==================================
66+This module Allow to create mail.composse.message from email_template like composition_model=comment
67+""",
68+ 'depends' : ['mail','email_template'],
69+ 'data': [
70+ 'view/email_template_view.xml'
71+ ],
72+ "active": False,
73+ "installable": True,
74+}
75+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
76+
77+
78
79=== added directory 'email_template_comment/model'
80=== added file 'email_template_comment/model/__init__.py'
81--- email_template_comment/model/__init__.py 1970-01-01 00:00:00 +0000
82+++ email_template_comment/model/__init__.py 2014-08-14 16:01:11 +0000
83@@ -0,0 +1,25 @@
84+#!/usr/bin/python
85+# -*- encoding: utf-8 -*-
86+###########################################################################
87+# Module Writen to OpenERP, Open Source Management Solution
88+# Copyright (C) 2013 Vauxoo (<http://vauxoo.com>).
89+# All Rights Reserved
90+###############Credits######################################################
91+# Coded by: vauxoo consultores (info@vauxoo.com)
92+#############################################################################
93+# This program is free software: you can redistribute it and/or modify
94+# it under the terms of the GNU Affero General Public License as published by
95+# the Free Software Foundation, either version 3 of the License, or
96+# (at your option) any later version.
97+#
98+# This program is distributed in the hope that it will be useful,
99+# but WITHOUT ANY WARRANTY; without even the implied warranty of
100+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
101+# GNU Affero General Public License for more details.
102+#
103+# You should have received a copy of the GNU Affero General Public License
104+# along with this program. If not, see <http://www.gnu.org/licenses/>.
105+################################################################################
106+
107+import email_template
108+import mail_compose_message
109
110=== added file 'email_template_comment/model/email_template.py'
111--- email_template_comment/model/email_template.py 1970-01-01 00:00:00 +0000
112+++ email_template_comment/model/email_template.py 2014-08-14 16:01:11 +0000
113@@ -0,0 +1,35 @@
114+#!/usr/bin/python
115+# -*- encoding: utf-8 -*-
116+###########################################################################
117+# Module Writen to OpenERP, Open Source Management Solution
118+# Copyright (C) 2013 Vauxoo (<http://vauxoo.com>).
119+# All Rights Reserved
120+###############Credits######################################################
121+# Coded by: vauxoo consultores (info@vauxoo.com)
122+#############################################################################
123+# This program is free software: you can redistribute it and/or modify
124+# it under the terms of the GNU Affero General Public License as published by
125+# the Free Software Foundation, either version 3 of the License, or
126+# (at your option) any later version.
127+#
128+# This program is distributed in the hope that it will be useful,
129+# but WITHOUT ANY WARRANTY; without even the implied warranty of
130+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
131+# GNU Affero General Public License for more details.
132+#
133+# You should have received a copy of the GNU Affero General Public License
134+# along with this program. If not, see <http://www.gnu.org/licenses/>.
135+################################################################################
136+
137+
138+from openerp.osv import osv, fields
139+from openerp import tools, SUPERUSER_ID
140+
141+class email_template(osv.Model):
142+
143+ _inherit = 'email.template'
144+
145+ _columns = {
146+ 'composition_mode_comment': fields.boolean('Composition Mode',
147+ help='Create Composition mode like comment'),
148+ }
149
150=== added file 'email_template_comment/model/mail_compose_message.py'
151--- email_template_comment/model/mail_compose_message.py 1970-01-01 00:00:00 +0000
152+++ email_template_comment/model/mail_compose_message.py 2014-08-14 16:01:11 +0000
153@@ -0,0 +1,45 @@
154+#!/usr/bin/python
155+# -*- encoding: utf-8 -*-
156+###########################################################################
157+# Module Writen to OpenERP, Open Source Management Solution
158+# Copyright (C) 2013 Vauxoo (<http://vauxoo.com>).
159+# All Rights Reserved
160+###############Credits######################################################
161+# Coded by: vauxoo consultores (info@vauxoo.com)
162+#############################################################################
163+# This program is free software: you can redistribute it and/or modify
164+# it under the terms of the GNU Affero General Public License as published by
165+# the Free Software Foundation, either version 3 of the License, or
166+# (at your option) any later version.
167+#
168+# This program is distributed in the hope that it will be useful,
169+# but WITHOUT ANY WARRANTY; without even the implied warranty of
170+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
171+# GNU Affero General Public License for more details.
172+#
173+# You should have received a copy of the GNU Affero General Public License
174+# along with this program. If not, see <http://www.gnu.org/licenses/>.
175+################################################################################
176+
177+
178+from openerp.osv import osv, fields
179+from openerp import tools, SUPERUSER_ID
180+
181+class mail_compose_message(osv.TransientModel):
182+
183+ _inherit = 'mail.compose.message'
184+
185+ def default_get(self, cr, uid, fields, context=None):
186+ if context is None:
187+ context = {}
188+
189+ email_template_obj = self.pool.get('email.template')
190+ result = super(mail_compose_message, self).default_get(cr, uid, fields, context=context)
191+
192+ template_id = context.get('default_template_id', False)
193+
194+ if template_id and\
195+ email_template_obj.browse(cr, uid, template_id,
196+ context=context).composition_mode_comment:
197+ result['composition_mode'] = 'comment'
198+ return result
199
200=== added directory 'email_template_comment/view'
201=== added file 'email_template_comment/view/email_template_view.xml'
202--- email_template_comment/view/email_template_view.xml 1970-01-01 00:00:00 +0000
203+++ email_template_comment/view/email_template_view.xml 2014-08-14 16:01:11 +0000
204@@ -0,0 +1,17 @@
205+<?xml version="1.0" encoding="utf-8"?>
206+<openerp>
207+ <data>
208+
209+ <record model="ir.ui.view" id="composition_comment_template_form">
210+ <field name="name">composition.comment.email.template</field>
211+ <field name="model">email.template</field>
212+ <field name="inherit_id" ref="email_template.email_template_form"/>
213+ <field name="arch" type="xml">
214+ <xpath expr="//field[@name='lang']" position="after">
215+ <field name="composition_mode_comment"/>
216+ </xpath>
217+ </field>
218+ </record>
219+
220+ </data>
221+</openerp>