Merge lp:~vauxoo/addons-vauxoo/jose-custom-template into lp:addons-vauxoo/7.0
- jose-custom-template
- Merge into 7.0
Status: | Needs review |
---|---|
Proposed branch: | lp:~vauxoo/addons-vauxoo/jose-custom-template |
Merge into: | lp:addons-vauxoo/7.0 |
Diff against target: |
671 lines (+617/-0) 9 files modified
email_template_no_sanitize/__init__.py (+2/-0) email_template_no_sanitize/__openerp__.py (+70/-0) email_template_no_sanitize/demo/custom_template_demo.xml (+328/-0) email_template_no_sanitize/model/__init__.py (+1/-0) email_template_no_sanitize/model/email_template.py (+45/-0) email_template_no_sanitize/view/email_template_view.xml (+17/-0) email_template_no_sanitize/wizard/__init__.py (+1/-0) email_template_no_sanitize/wizard/compose_mail.py (+137/-0) email_template_no_sanitize/wizard/compose_mail_view.xml (+16/-0) |
To merge this branch: | bzr merge lp:~vauxoo/addons-vauxoo/jose-custom-template |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com | Pending | ||
Review via email: mp+223841@code.launchpad.net |
This proposal supersedes a proposal from 2014-06-18.
Commit message
Description of the change
Custom Template
To post a comment you must log in.
Unmerged revisions
- 1044. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com
-
[IMP] Rename module and change description
- 1043. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com
-
[ADD] Added a demo template in partner model
- 1042. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com
-
[IMP] Validate the second body of the html message
- 1041. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com
-
[IMP] Rename the module
- 1040. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com
-
[IMP] Added description in openerp file
- 1039. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com
-
[IMP] Modified the send_mail method to send a custom template without pass by the openerp sanitize method because it removes all features added to templates
- 1038. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com
-
[ADD] Added new model for we can to add custom templated the we can sent it without use the sanitize method of odoo used in html field
- 1037. By Jose Antonio Morales Ponce(vauxoo) - - 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_no_sanitize' |
2 | === added file 'email_template_no_sanitize/__init__.py' |
3 | --- email_template_no_sanitize/__init__.py 1970-01-01 00:00:00 +0000 |
4 | +++ email_template_no_sanitize/__init__.py 2014-06-19 22:33:02 +0000 |
5 | @@ -0,0 +1,2 @@ |
6 | +import wizard |
7 | +import model |
8 | |
9 | === added file 'email_template_no_sanitize/__openerp__.py' |
10 | --- email_template_no_sanitize/__openerp__.py 1970-01-01 00:00:00 +0000 |
11 | +++ email_template_no_sanitize/__openerp__.py 2014-06-19 22:33:02 +0000 |
12 | @@ -0,0 +1,70 @@ |
13 | +# -*- coding: utf-8 -*- |
14 | +############################################################################## |
15 | +# |
16 | +# OpenERP, Open Source Management Solution |
17 | +# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
18 | +# |
19 | +# This program is free software: you can redistribute it and/or modify |
20 | +# it under the terms of the GNU Affero General Public License as |
21 | +# published by the Free Software Foundation, either version 3 of the |
22 | +# License, or (at your option) any later version. |
23 | +# |
24 | +# This program is distributed in the hope that it will be useful, |
25 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
26 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
27 | +# GNU Affero General Public License for more details. |
28 | +# |
29 | +# You should have received a copy of the GNU Affero General Public License |
30 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
31 | +# |
32 | +############################################################################## |
33 | +{ |
34 | + 'name' : 'Email Template without Sanitized', |
35 | + 'version' : '0.1', |
36 | + 'author' : 'Vauxoo', |
37 | + 'category' : '', |
38 | + 'description' : """ |
39 | +Email Templates Without Sanitize |
40 | +================ |
41 | +- When you need to create a custom template with the email.template model |
42 | + and add some cool features to your template at the moment that you try to |
43 | + send it you see that the sanitize method of openerp changes all your |
44 | + template and became to a different template. To avoid this problem we |
45 | + created this module. |
46 | + |
47 | +How to Use |
48 | +========== |
49 | +- In the template view we add 2 new fields in the Advanced page. The first |
50 | + field is a boolean, used to define the template like important, this makes |
51 | + that template's content will not be sanitize. |
52 | + |
53 | +- The second field is a string, where you define the name of the attachment |
54 | + generated when you send your custom template, because the custom template |
55 | + will generate an attachment and puts it in the message post of the model |
56 | + """, |
57 | + 'website': 'http://www.vauxoo.com', |
58 | + 'images' : [], |
59 | + 'depends' : [ |
60 | + 'mail', |
61 | + 'email_template', |
62 | + ], |
63 | + 'data': [ |
64 | + 'wizard/compose_mail_view.xml', |
65 | + 'view/email_template_view.xml', |
66 | + ], |
67 | + 'js': [ |
68 | + ], |
69 | + 'qweb' : [ |
70 | + ], |
71 | + 'css':[ |
72 | + ], |
73 | + 'demo': [ |
74 | + 'demo/custom_template_demo.xml', |
75 | + ], |
76 | + 'test': [ |
77 | + ], |
78 | + 'installable': True, |
79 | + 'auto_install': False, |
80 | +} |
81 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
82 | + |
83 | |
84 | === added directory 'email_template_no_sanitize/data' |
85 | === added directory 'email_template_no_sanitize/demo' |
86 | === added file 'email_template_no_sanitize/demo/custom_template_demo.xml' |
87 | --- email_template_no_sanitize/demo/custom_template_demo.xml 1970-01-01 00:00:00 +0000 |
88 | +++ email_template_no_sanitize/demo/custom_template_demo.xml 2014-06-19 22:33:02 +0000 |
89 | @@ -0,0 +1,328 @@ |
90 | +<?xml version="1.0"?> |
91 | +<openerp> |
92 | + <!-- Mail template is done in a NOUPDATE block |
93 | + so users can freely customize/delete them --> |
94 | + <data noupdate="1"> |
95 | + <!--Email template Post training --> |
96 | + <record id="email_template_custom" model="email.template"> |
97 | + <field name="name">Custom Template Demo</field> |
98 | + <field name="email_to">${(object.user_id.email or '')|safe}</field> |
99 | + <field name="email_from"></field> |
100 | + <field name="reply_to"></field> |
101 | + <field name="subject">Important Information</field> |
102 | + <field name="model_id" ref="base.model_res_partner"/> |
103 | + <field name="special" eval="True"/> |
104 | + <field name="special_name">Partner</field> |
105 | + <field name="auto_delete" eval="True"/> |
106 | + <field name="lang">${object.lang}</field> |
107 | + <field name="body_html"> |
108 | + <![CDATA[ |
109 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
110 | +<html xmlns="http://www.w3.org/1999/xhtml"> |
111 | +<head> |
112 | +<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> |
113 | +<title></title> |
114 | + |
115 | +<style type="text/css"> |
116 | + |
117 | +@media only screen and (max-width: 500px) { |
118 | + html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } |
119 | + .mobile-width{width:320px!important;} |
120 | + .hide{display:none;} |
121 | + .header-image{width:380px!important; height:137px!important;} |
122 | + .float-left{float:left; border-top:none!important;} |
123 | + .float-right{float:right;} |
124 | + .banner-ad-top{padding-top:20px!important; padding-bottom:20px!important; padding-left:92px!important; padding-right:0!important;} |
125 | + .banner-ad-middle{padding-top:0!important; padding-bottom:0!important; padding-left:92px!important; padding-right:0!important;} |
126 | + .banner-ad-bottom{padding-top:20px!important; padding-bottom:20px!important; padding-left:92px!important; padding-right:0!important;} |
127 | + .consultant-info{padding-right:0!important; border-right:none!important;} |
128 | + .more-icons-top{padding:20px 20px 0 20px!important;} |
129 | + .more-icons-bottom{border-top:none!important; padding:20px 20px 0 20px!important;} |
130 | + .more-icons-title{padding:0 20px 20px 20px!important;} |
131 | + .more-icons-text{padding:0 20px!important;} |
132 | +} |
133 | + |
134 | +</style> |
135 | + |
136 | +</head> |
137 | + |
138 | +<body style="margin:0;" rightmargin="0" leftmargin="0" topmargin="0" bottommargin="0" bgcolor="#ffffff"> |
139 | + |
140 | +<table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="#ffffff" text="#373737"> |
141 | + <tbody> |
142 | + <tr> |
143 | + <td> |
144 | + <!-- START Main Container --> |
145 | + <table width="625" class="mobile-width" cellspacing="0" cellpadding="0" border="0" align="center"> |
146 | + <thead> |
147 | + <tr> |
148 | +<h1>Hi ${object.name}</h1> |
149 | + <!-- START Subject Line --> |
150 | + <td colspan="2" style="padding:5px 10px;" bgcolor="#ffffff"> |
151 | + <a href="#" alt="View in Browser" title="View in Browser" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#0083d2; text-decoration:none;">Save with Celebrity Cruises: Choose Your Offer!</a> |
152 | + </td> |
153 | + <td colspan="2" style="padding:5px 10px;" align="right" bgcolor="#ffffff" valign="middle" class="hide"> |
154 | + <!--<p style="color:#0083d2; margin-top:0; margin-bottom:0; margin-left:0; margin-right:0; font-size:12px; line-height:18px; font-family:Arial, sans-serif;"><a style="color:#0083d2; margin-top:0; margin-bottom:0; margin-left:0; margin-right:0; font-size:12px; line-height:18px; font-family:Arial, sans-serif; text-decoration:none;" href="#" alt="View in Browser" title="View in Browser">Web Version »</a></p>--> |
155 | + <a href="#" alt="View in Browser" title="View in Browser" style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#0083d2; text-decoration:none;">Web Version »</a> |
156 | + </td> |
157 | + <!-- END Subject Line --> |
158 | + </tr> |
159 | + <tr> |
160 | + <!-- START Header --> |
161 | + <td colspan="4" bgcolor="#f1f8fe" background="http://www.cruiseshipcenters.com/csflash/ECSC/img/header-bg-625.jpg" style="padding:0 10px;" height="80" class="mobile-width"> |
162 | + <table cellspacing="0" cellpadding="0" border="0" width="605" class="mobile-width"> |
163 | + <tbody> |
164 | + <tr> |
165 | + <td align="right" style="padding:10px 0;" height="60" width="205" class="hide"> |
166 | + <table cellspacing="0" cellpadding="0" border="0" width="205"> |
167 | + <tr> |
168 | + <td align="right" valign="top" style="padding-bottom:5px;" width="180" height="15"><a href="#" title="Follow Us on Facebook" alt="Follow Us on Facebook"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/facebook-icon.gif" width="15" height="15" style="display:block;" border="0"/></a></td> |
169 | + <td align="right" valign="top" style="padding-bottom:5px;" height="15"><a href="#" title="Follow Us on Twitter" alt="Follow Us on Twitter"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/twitter-icon.gif" width="15" height="15" style="display:block;" border="0"/></a></td> |
170 | + </tr> |
171 | + <tr> |
172 | + <td colspan="2" align="right"> |
173 | + </td> |
174 | + </tr> |
175 | + </table> |
176 | + </td> |
177 | + </tr> |
178 | + </tbody> |
179 | + </table> |
180 | + </td> |
181 | + <!-- END Header --> |
182 | + </tr> |
183 | + <tr class="hide"> |
184 | + <!-- START Nav --> |
185 | + <td bgcolor="#0083d2" width="145" height="28"><center><a href="#" style="border-right:1px solid #339CDB; border-left:1px solid #339CDB; color:#ffffff; font-family:Arial, sans-serif; font-weight:bold; font-size:12px; line-height:18px; text-decoration:none; display:block; padding-top:5px; padding-bottom:5px; padding-left:5px; padding-right:5px; text-align:center; outline:none;"><span style="color:#ffffff; font-weight:bold; font-size:12px; line-height:18px; text-decoration:none; display:block; text-align:center; outline:none;">Destinations</span></a></center></td> |
186 | + <td bgcolor="#0083d2" width="145" height="28"><center><a href="#" style="border-right:1px solid #339CDB; color:#ffffff; font-family:Arial, sans-serif; font-weight:bold; font-size:12px; line-height:18px; text-decoration:none; display:block; padding-top:5px; padding-bottom:5px; padding-left:5px; padding-right:5px; text-align:center; outline:none;"><span style="color:#ffffff; font-weight:bold; font-size:12px; line-height:18px; text-decoration:none; display:block; text-align:center; outline:none;">Cruise Lines</span></a></center></td> |
187 | + <td bgcolor="#0083d2" width="145" height="28"><center><a href="#" style="border-right:1px solid #339CDB; color:#ffffff; font-family:Arial, sans-serif; font-weight:bold; font-size:12px; line-height:18px; text-decoration:none; display:block; padding-top:5px; padding-bottom:5px; padding-left:5px; padding-right:5px; text-align:center; outline:none;"><span style="color:#ffffff; font-weight:bold; font-size:12px; line-height:18px; text-decoration:none; display:block; text-align:center; outline:none;">Land Vacations</span></a></center></td> |
188 | + <td bgcolor="#0083d2" width="145" height="28"><center><a href="#" style="border-right:1px solid #339CDB; color:#ffffff; font-family:Arial, sans-serif; font-weight:bold; font-size:12px; line-height:18px; text-decoration:none; display:block; padding-top:5px; padding-bottom:5px; padding-left:5px; padding-right:5px; text-align:center; outline:none;"><span style="color:#ffffff; font-weight:bold; font-size:12px; line-height:18px; text-decoration:none; display:block; text-align:center; outline:none;">Deals</span></a></center></td> |
189 | + <!-- END Nav --> |
190 | + </tr> |
191 | + </thead> |
192 | + <tbody> |
193 | + <tr> |
194 | + <!-- START Hero Image --> |
195 | + <td colspan="4" width="625"><a href="#" title="Save with Celebrity Cruises" alt="Save with Celebrity Cruises"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/email-header.jpg" class="header-image" title="Save with Celebrity Cruises" alt="Save with Celebrity Cruises" width="625" height="225" border="0" style="display:block;"/></a></td> |
196 | + <!-- END Hero Image --> |
197 | + </tr> |
198 | + <tr> |
199 | + <!-- START Main Copy --> |
200 | + <td colspan="4" bgcolor="#eeeeee" style="padding:20px; border-bottom:1px solid #cccccc;" class="mobile-width"> |
201 | + <p class="mobile-width" style="margin-top:0; margin-bottom:18px; margin-left:0; margin-right:0; font-size:12px; line-height:18px; font-family:Arial, sans-serif;color:#373737;">Dear (first name),</p> |
202 | + <p class="mobile-width" style="margin-top:0; margin-bottom:18px; margin-left:0; margin-right:0; font-size:12px; line-height:18px; font-family:Arial, sans-serif;color:#373737;">As someone who loves to cruise, I want you to be the first to know about Celebrity Cruises' exciting new 2014 Alaska and Europe itineraries available during our exceptional One Week Sale! Book select 2013 or 2014 Alaska or Europe sailings between March 15-21, 2013, and enjoy one or more of our <span style="color:#004990; font-weight:bold;"></span> <span style="color:#c60000; font-weight:bold;">Extras</span>:</p> |
203 | + <table cellspacing="0" cellpadding="0" border="0" width="565" class="mobile-width"> |
204 | + <tbody> |
205 | + <tr> |
206 | + <td valign="top" width="13" style="padding-left:20px;"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/arrow-bullet.gif" height="13" width="13" style="display:block;"/></td> |
207 | + <td style="padding-bottom:10px; padding-left:10px;"><span style="font-size:12px; line-height:18px; font-family:Arial, sans-serif;color:#373737;">$650 worth of savings in two onboard coupon books. $650 worth of savings in two onboard coupon books</span></td> |
208 | + </tr> |
209 | + <tr> |
210 | + <td valign="top" width="13" style="padding-left:20px;"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/arrow-bullet.gif" height="13" width="13" style="display:block;"/></td> |
211 | + <td style="padding-bottom:10px; padding-left:10px;"><span style="font-size:12px; line-height:18px; font-family:Arial, sans-serif;color:#373737;">Reduced deposit of only $100</span></td> |
212 | + </tr> |
213 | + <tr> |
214 | + <td valign="top" width="13" style="padding-left:20px;"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/arrow-bullet.gif" height="13" width="13" style="display:block;"/></td> |
215 | + <td style="padding-bottom:10px; padding-left:10px;"><span style="font-size:12px; line-height:18px; font-family:Arial, sans-serif;color:#373737;">Plus, Captain's Circle members can enjoy an extra savings of $100!</span></td> |
216 | + </tr> |
217 | + </tbody> |
218 | + </table> |
219 | + <p class="mobile-width" style="margin-top:0; margin-bottom:18px; margin-left:0; margin-right:0; font-size:12px; line-height:18px; font-family:Arial, sans-serif;color:#373737;">These new itineraries fill up fast, so reserve your ideal cabin today with a deposit as little as $100 per person!</p> |
220 | + |
221 | + <div><!--[if mso]> |
222 | + <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:26px;v-text-anchor:middle;width:150px;" arcsize="12%" stroke="f" fill="t"> |
223 | + <v:fill type="tile" src="http://www.cruiseshipcenters.com/csflash/ECSC/img/red-button.gif" color="#c60000" /> |
224 | + <w:anchorlock/> |
225 | + <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">See Details</center> |
226 | + </v:roundrect> |
227 | +<![endif]--><![if !mso]><a href="#" style="background-color:#c60000; background-image:url(http://www.cruiseshipcenters.com/csflash/ECSC/img/red-button.gif); border-radius:3px; color:#ffffff; display:inline-block; font-family:Arial,sans-serif; font-size:14px; font-weight:bold; line-height:26px; text-align:center; text-decoration:none; width:150px; -webkit-text-size-adjust:none;">See Details</a><![endif]></div></a> |
228 | + </td> |
229 | + <!-- END Main Copy --> |
230 | + </tr> |
231 | + <tr> |
232 | + <!-- START Consultant Info --> |
233 | + <td colspan="4" bgcolor="#eeeeee" style="border-bottom:1px solid #cccccc;" class="mobile-width"> |
234 | + <table cellspacing="0" cellpadding="0" border="0" width="625" class="mobile-width"> |
235 | + <tbody> |
236 | + <tr> |
237 | + <td style="background:#eeeeee; padding-top:20px; padding-bottom:20px; padding-left:20px; border-top:1px solid #ffffff;" width="116"> |
238 | + <img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/cruise-consultant-placeholder.jpg" width="100" height="113" alt="Consultant Name" title="Consultant Name" style="padding-top:8px; padding-bottom:8px; padding-left:8px; padding-right:8px; background:#ffffff; display:block;"/> |
239 | + </td> |
240 | + <td style="padding-top:20px; padding-bottom:20px; padding-left:10px; padding-right:20px; border-right:1px solid #cccccc; border-top:1px solid #ffffff;" width="234" valign="top" class="float-right consultant-info"><h4 style="font-family:Arial, sans-serif; font-size:16px; line-height:24px; font-weight:bold; margin-top:0; margin-bottom:10px; margin-left:0; margin-right:0; color:#373737;"><span style="color:#373737; margin-bottom:5px;">Questions? I'm here to help</span></h4> |
241 | + <p style="margin-top:0; margin-bottom:10px; margin-left:0; margin-right:0; font-size:12px; line-height:18px; font-family:Arial, sans-serif;color:#373737;">Ivanna Cruise<br/>Vacation Consultant<br/>1-800-767-7327 ext 1234</p> |
242 | + |
243 | + <div><!--[if mso]> |
244 | + <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:26px;v-text-anchor:middle;width:150px;" arcsize="12%" stroke="f" fill="t"> |
245 | + <v:fill type="tile" src="http://www.cruiseshipcenters.com/csflash/ECSC/img/blue-button.gif" color="#0083d2" /> |
246 | + <w:anchorlock/> |
247 | + <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">Get Assistance</center> |
248 | + </v:roundrect> |
249 | +<![endif]--><![if !mso]><a href="#" style="background-color:#0083d2; background-image:url(http://www.cruiseshipcenters.com/csflash/ECSC/img/blue-button.gif); border-radius:3px; color:#ffffff; display:inline-block; font-family:Arial,sans-serif; font-size:14px; font-weight:bold; line-height:26px; text-align:center; text-decoration:none; width:150px; -webkit-text-size-adjust:none;">Get Assistance</a><![endif]></div></td> |
250 | + |
251 | + <td width="185" valign="top" style="padding-top:20px; padding-bottom:20px; padding-left:20px; padding-right:20px; border-top:1px solid #ffffff;" class="hide"> |
252 | + <h4 style="font-family:Arial, sans-serif; font-size:16px; line-height:24px; font-weight:bold; margin-top:0; margin-bottom:10px; margin-left:0; margin-right:0; color:#373737"><span style="color:#373737;">Our Promise</span></h4> |
253 | + <table cellspacing="0" cellpadding="0" border="0" width="185"> |
254 | + <tbody> |
255 | + <tr> |
256 | + <td valign="top" width="13"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/arrow-bullet.gif" height="13" width="13" style="display:block;"/></td><td style="padding-bottom:5px; padding-left:10px;"><span style="font-size:12px; line-height:18px; font-family:Arial, sans-serif; color:#0083d2;">Advice you can trust.</span></td> |
257 | + </tr> |
258 | + <tr> |
259 | + <td valign="top" width="13"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/arrow-bullet.gif" height="13" width="13" style="display:block;"/></td><td style="padding-bottom:5px; padding-left:10px;"><span style="font-size:12px; line-height:18px; font-family:Arial, sans-serif; color:#0083d2;">The best choice and prices.</span></td> |
260 | + </tr> |
261 | + <tr> |
262 | + <td valign="top" width="13"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/arrow-bullet.gif" height="13" width="13" style="display:block;"/></td><td style="padding-bottom:5px; padding-left:10px;"><span style="font-size:12px; line-height:18px; font-family:Arial, sans-serif; color:#0083d2;"></span></td> |
263 | + </tr> |
264 | + <tr> |
265 | + <td valign="top" width="13"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/arrow-bullet.gif" height="13" width="13" style="display:block;"/></td><td style="padding-bottom:5px; padding-left:10px;"><span style="font-size:12px; line-height:18px; font-family:Arial, sans-serif; color:#0083d2;">More than cruises.</span></td> |
266 | + </tr> |
267 | + <tr> |
268 | + <td valign="top" width="13"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/arrow-bullet.gif" height="13" width="13" style="display:block;"/></td><td style="padding-bottom:5px; padding-left:10px;"><span style="font-size:12px; line-height:18px; font-family:Arial, sans-serif; color:#0083d2;">Always there.</span></td> |
269 | + </tr> |
270 | + </tbody> |
271 | + </table> |
272 | + </td> |
273 | + |
274 | + </tr> |
275 | + </tbody> |
276 | + </table> |
277 | + </td> |
278 | + <!-- END Consultant Info --> |
279 | + </tr> |
280 | + <tr> |
281 | + <!-- START Custom Promotion --> |
282 | + <td colspan="4" bgcolor="#eeeeee" style="border-bottom:1px solid #cccccc; border-top:1px solid #ffffff;" class="mobile-width"> |
283 | + <table cellspacing="0" cellpadding="0" border="0" width="625" class="mobile-width"> |
284 | + <tbody> |
285 | + <tr> |
286 | + <td style="padding:20px;" valign="top" width="400"><h4 style="font-family:Arial, sans-serif; font-size:16px; line-height:24px; font-weight:bold; margin-top:0; margin-bottom:10px; margin-left:0; margin-right:0; color:#373737"><span style="color:#373737;">Upcoming River Cruise Night!</span></h4> |
287 | + <p style="margin-top:0; margin-bottom:18px; margin-left:0; margin-right:0; font-size:12px; font-family:Arial, sans-serif; line-height:18px; color:#373737;">Join us in Brantford and enjoy a glass of wine and learn all about cruising the rivers of Europe with AMA Waterways!</p> |
288 | + <div><!--[if mso]> |
289 | + <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:26px;v-text-anchor:middle;width:150px;" arcsize="12%" stroke="f" fill="t"> |
290 | + <v:fill type="tile" src="http://www.cruiseshipcenters.com/csflash/ECSC/img/red-button.gif" color="#c60000" /> |
291 | + <w:anchorlock/> |
292 | + <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">See Details</center> |
293 | + </v:roundrect> |
294 | +<![endif]--><![if !mso]><a href="#" style="background-color:#c60000; background-image:url(http://www.cruiseshipcenters.com/csflash/ECSC/img/red-button.gif); border-radius:3px; color:#ffffff; display:inline-block; font-family:Arial,sans-serif; font-size:14px; font-weight:bold; line-height:26px; text-align:center; text-decoration:none; width:150px; -webkit-text-size-adjust:none;">See Details</a><![endif]></div></td><td style="padding:20px 20px 20px 0;" width="165" height="129"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/custom-promo-image.jpg" style="padding-top:8px; padding-bottom:8px; padding-left:8px; padding-right:8px; background:#ffffff;" alt="Custom Promo Title" title="Custom Promo Title" width="149" height="113" style="display:block;"/></td> |
295 | + </tr> |
296 | + </tbody> |
297 | + </table> |
298 | + </td> |
299 | + <!-- END Custom Promotion --> |
300 | + </tr> |
301 | + <tr> |
302 | + <!-- START Banner Ads --> |
303 | + <td colspan="4" style="border-bottom:1px solid #cccccc;" bgcolor="#C0D9E8" class="mobile-width"> |
304 | + <table cellspacing="0" cellpadding="0" border="0" width="625" class="mobile-width"> |
305 | + <tbody> |
306 | + <tr> |
307 | + <td style="padding:20px; border-top:1px solid #ffffff;" class="float-left banner-ad-top" align="center"> |
308 | + <a href="#" alt="Redeem Aeroplan Miles" title="Redeem Aeroplan Miles"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/aeroplan_enCA.jpg" alt="Redeem Aeroplan Miles" title="Redeem Aeroplan Miles" height="120" width="165" style="padding-top:8px; padding-bottom:8px; padding-left:8px; padding-right:8px; background:#ffffff; display:block;" border="0"/></a> |
309 | + </td> |
310 | + <td style="padding:20px 0; border-top:1px solid #ffffff;" class="float-left banner-ad-middle"> |
311 | + <a href="#" alt="Vacation Packages" title="Vacation Packages"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/vacation_enCA.jpg" alt="Vacation Packages" title="Vacation Packages" height="120" width="165" style="padding-top:8px; padding-bottom:8px; padding-left:8px; padding-right:8px; background:#ffffff; display:block;" border="0"/></a> |
312 | + </td> |
313 | + <td style="padding:20px; border-top:1px solid #ffffff;" class="float-left banner-ad-bottom"> |
314 | + <a href="#" alt="Travel Insurance" title="Travel Insurance"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/insurance_enCA.jpg" alt="Travel Insurance" title="Travel Insurance" height="120" width="165" style="padding-top:8px; padding-bottom:8px; padding-left:8px; padding-right:8px; background:#ffffff; display:block;" border="0"/></a> |
315 | + </td> |
316 | + </tr> |
317 | + </tbody> |
318 | + </table> |
319 | + </td> |
320 | + <!-- END Banner Ads --> |
321 | + </tr> |
322 | + <tr> |
323 | + <!-- START Banner Ad --> |
324 | + <td colspan="4" bgcolor="#eeeeee" class="mobile-width"> |
325 | + <table cellspacing="0" cellpadding="0" border="0" width="625" class="mobile-width"> |
326 | + <tbody> |
327 | + <tr> |
328 | + <td class="float-left"> |
329 | + <table cellspacing="0" cellpadding="0" border="0" class="mobile-width"> |
330 | + <tbody> |
331 | + <tr> |
332 | + <td style="padding-top:20px; padding-left:20px; padding-right:10px; border-top:1px solid #ffffff;" class="more-icons-top"><a href="#" alt="Vacation Packages" title="Vacation Packages"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/icon-vacations.gif" style="display:block;" border="0" width="80"/></a></td> |
333 | + <td style="padding-top:20px; padding-left:10px; padding-right:10px; border-top:1px solid #ffffff;" class="more-icons-top"><a href="#" alt="Coach & Rail Tours" title="Coach & Rail Tours"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/icon-tours.gif" style="display:block;" border="0" width="80"/></a></td> |
334 | + <td style="padding-top:20px; padding-left:10px; padding-right:10px; border-top:1px solid #ffffff;" class="more-icons-top"><a href="#" alt="Travel Insurance" title="Travel Insurance"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/icon-insurance.gif" style="display:block;" border="0" width="80"/></a></td> |
335 | + </tr> |
336 | + <tr> |
337 | + <td style="padding-bottom:20px; padding-left:20px; padding-right:10px;" class="more-icons-title"><center><a href="#" alt="Vacation Packages" title="Vacation Packages" style="text-align:center; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#004990; text-decoration:none;">Vacation Packages</a></center></td> |
338 | + <td style="padding-bottom:20px; padding-left:10px; padding-right:10px;" class="more-icons-title"><center><a href="#" alt="Coach & Rail Tours" title="Coach & Rail Tours" style="text-align:center; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#004990; text-decoration:none;">Coach & Rail Tours</a></center></td> |
339 | + <td style="padding-bottom:20px; padding-left:10px; padding-right:10px;" class="more-icons-title"><center><a href="#" alt="Travel Insurance" title="Travel Insurance" style="text-align:center; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#004990; text-decoration:none;">Travel Insurance</a></center></td> </tr> |
340 | + </tbody> |
341 | + </table> |
342 | + </td> |
343 | + <td valign="top" class="float-left"> |
344 | + <table cellspacing="0" cellpadding="0" border="0" class="mobile-width"> |
345 | + <tbody> |
346 | + <tr> |
347 | + <td style="padding-top:20px; padding-left:10px; padding-right:10px; border-top:1px solid #ffffff;" valign="top" class="more-icons-bottom"><a href="#" alt="Flights" title="Flights"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/icon-flights.gif" style="display:block;" border="0" width="80"/></a></td> |
348 | + <td style="padding-top:20px; padding-left:10px; padding-right:10px; border-top:1px solid #ffffff;" valign="top" class="more-icons-bottom"><a href="#" alt="Hotels" title="Hotels"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/icon-hotels.gif" style="display:block;" border="0" width="80"/></a></td> |
349 | + <td style="padding-top:20px; padding-left:10px; padding-right:20px; border-top:1px solid #ffffff;" valign="top" class="more-icons-bottom"><a href="#" alt="Car Rentals" title="Car Rentals"><img src="http://www.cruiseshipcenters.com/csflash/ECSC/img/icon-cars.gif" style="display:block;" border="0" width="80"/></a></td> |
350 | + </tr> |
351 | + <tr> |
352 | + <td style="padding-bottom:20px; padding-left:10px; padding-right:10px;" valign="top" class="more-icons-title"><center><a href="#" alt="Flights" title="Flights" style="text-align:center; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#004990; text-decoration:none;">Flights</a></center></td> |
353 | + <td style="padding-bottom:20px; padding-left:10px; padding-right:10px;" valign="top" class="more-icons-title"><center><a href="#" alt="Hotels" title="Hotels" style="text-align:center; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#004990; text-decoration:none;">Hotels</a></center></td> |
354 | + <td style="padding-bottom:20px; padding-left:10px; padding-right:20px;" valign="top" class="more-icons-title"><center><a href="#" alt="Car Rentals" title="Car Rentals" style="text-align:center; font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#004990; text-decoration:none;">Car Rentals</a></center></td> |
355 | + </tr> |
356 | + </tbody> |
357 | + </table> |
358 | + </td> |
359 | + </tr> |
360 | + |
361 | + <tr> |
362 | + <td colspan="6" style="padding-left:130px; padding-right:130px;" align="center" class="more-icons-text"> |
363 | + <p class="mobile-width" style="margin-top:0; margin-bottom:18px; margin-left:0; margin-right:0; font-size:12px; line-height:18px; font-family:Arial, sans-serif;color:#004990;"></p> |
364 | + </td> |
365 | + </tr> |
366 | + <tr> |
367 | + <td colspan="6" style="padding-bottom:20px;" align="center"> |
368 | + <div><!--[if mso]> |
369 | + <v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="height:26px;v-text-anchor:middle;width:150px;" arcsize="12%" stroke="f" fill="t"> |
370 | + <v:fill type="tile" src="http://www.cruiseshipcenters.com/csflash/ECSC/img/blue-button.gif" color="#0083d2" /> |
371 | + <w:anchorlock/> |
372 | + <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">Get Assistance</center> |
373 | + </v:roundrect> |
374 | +<![endif]--><![if !mso]><a href="#" style="background-color:#0083d2; background-image:url(http://www.cruiseshipcenters.com/csflash/ECSC/img/blue-button.gif); border-radius:3px; color:#ffffff; display:inline-block; font-family:Arial,sans-serif; font-size:14px; font-weight:bold; line-height:26px; text-align:center; text-decoration:none; width:150px; -webkit-text-size-adjust:none;">Get Assistance</a><![endif]></div></td> |
375 | + </tr> |
376 | + </tbody> |
377 | + </table> |
378 | + </td> |
379 | + <!-- END Banner Ad --> |
380 | + </tr> |
381 | + <tr> |
382 | + <!-- START Legal Info --> |
383 | + <td colspan="4" bgcolor="#ffffff" style="padding:20px;" class="mobile-width"> |
384 | + <p class="mobile-width" style="font-size:12px; font-family: Arial, sans-serif; color:#999999; line-height:18px; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px;"></p> |
385 | + </td> |
386 | + <!-- END Legal Info --> |
387 | + </tr> |
388 | + </tbody> |
389 | + <tfoot> |
390 | + <tr> |
391 | + <!-- START Footer --> |
392 | + <td colspan="4" bgcolor="#ffffff" style="padding:20px; border-top:1px solid #ffffff; font-family: Arial, sans-serif; font-size:12px; color:#999999; line-height:18px;" class="mobile-width"> |
393 | + <p class="mobile-width" style="font-family: Arial, sans-serif; font-size:12px; color:#999999; line-height:18px; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px;">Dave Mossop – </p> |
394 | + <p class="mobile-width" style="font-family: Arial, sans-serif; font-size:12px; color:#999999; line-height:18px; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px;"></p> |
395 | + <p class="mobile-width" style="font-family: Arial, sans-serif; font-size:12px; color:#999999; line-height:18px; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px;"><a style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#999999;" href="#" title="Unsubscribe" alt="Unsubscribe">Modify or Unsubscribe Your Email Subscriptions</a></p> |
396 | + <p class="mobile-width" style="font-family: Arial, sans-serif; font-size:12px; color:#999999; line-height:18px; margin-top:5px; margin-bottom:5px; margin-left:5px; margin-right:5px;"></p> |
397 | + </td> |
398 | + <!-- END Footer --> |
399 | + </tr> |
400 | + </tfoot> |
401 | + </table><!-- END Main Container --> |
402 | + </td> |
403 | + </tr> |
404 | + </tbody> |
405 | +</table> |
406 | +</body> |
407 | +</html>]]> |
408 | + </field> |
409 | + </record> |
410 | + |
411 | + <!-- Create Action to test at same time the method create_action --> |
412 | + |
413 | + <function name="create_action" model="email.template"> |
414 | + <value eval="[ref('email_template_custom')]"/> |
415 | + </function> |
416 | + </data> |
417 | +</openerp> |
418 | |
419 | === added directory 'email_template_no_sanitize/i18n' |
420 | === added directory 'email_template_no_sanitize/model' |
421 | === added file 'email_template_no_sanitize/model/__init__.py' |
422 | --- email_template_no_sanitize/model/__init__.py 1970-01-01 00:00:00 +0000 |
423 | +++ email_template_no_sanitize/model/__init__.py 2014-06-19 22:33:02 +0000 |
424 | @@ -0,0 +1,1 @@ |
425 | +import email_template |
426 | |
427 | === added file 'email_template_no_sanitize/model/email_template.py' |
428 | --- email_template_no_sanitize/model/email_template.py 1970-01-01 00:00:00 +0000 |
429 | +++ email_template_no_sanitize/model/email_template.py 2014-06-19 22:33:02 +0000 |
430 | @@ -0,0 +1,45 @@ |
431 | +# -*- coding: utf-8 -*- |
432 | +############################################################################## |
433 | +# |
434 | +# OpenERP, Open Source Management Solution |
435 | +# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) |
436 | +# |
437 | +# This program is free software: you can redistribute it and/or modify |
438 | +# it under the terms of the GNU General Public License as published by |
439 | +# the Free Software Foundation, either version 3 of the License, or |
440 | +# (at your option) any later version. |
441 | +# |
442 | +# This program is distributed in the hope that it will be useful, |
443 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
444 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
445 | +# GNU General Public License for more details. |
446 | +# |
447 | +# You should have received a copy of the GNU General Public License |
448 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
449 | +# |
450 | +############################################################################## |
451 | + |
452 | +from openerp import SUPERUSER_ID |
453 | +from openerp.osv import osv |
454 | +from openerp.osv import fields |
455 | +from openerp.tools.translate import _ |
456 | + |
457 | + |
458 | +class email_template(osv.Model): |
459 | + |
460 | + _inherit = 'email.template' |
461 | + |
462 | + _columns = { |
463 | + |
464 | + 'special':fields.boolean('Special Template', |
465 | + help='Used to define this template like ' |
466 | + 'special, and avoid sanitize its ' |
467 | + 'content'), |
468 | + 'special_name':fields.char('Name of file to send', 64, |
469 | + help='The special templates generate an ' |
470 | + 'attachment, with this field you ' |
471 | + 'define the name of these ' |
472 | + 'attachments'), |
473 | + |
474 | + |
475 | + } |
476 | |
477 | === added directory 'email_template_no_sanitize/security' |
478 | === added directory 'email_template_no_sanitize/view' |
479 | === added file 'email_template_no_sanitize/view/email_template_view.xml' |
480 | --- email_template_no_sanitize/view/email_template_view.xml 1970-01-01 00:00:00 +0000 |
481 | +++ email_template_no_sanitize/view/email_template_view.xml 2014-06-19 22:33:02 +0000 |
482 | @@ -0,0 +1,17 @@ |
483 | +<?xml version="1.0" encoding="utf-8"?> |
484 | +<openerp> |
485 | + <data> |
486 | + <record model="ir.ui.view" id="email_template_ink_template"> |
487 | + <field name="name">email.template</field> |
488 | + <field name="model">email.template</field> |
489 | + <field name="inherit_id" ref="email_template.email_template_form"/> |
490 | + <field name="arch" type="xml"> |
491 | + <xpath expr='//field[@name="auto_delete"]' position='before'> |
492 | + <field name="special"/> |
493 | + <field name="special_name" attrs="{'invisible':[('special', '=', False)], 'required':[('special', '=', True)]}"/> |
494 | + </xpath> |
495 | + </field> |
496 | + </record> |
497 | + |
498 | + </data> |
499 | +</openerp> |
500 | |
501 | === added directory 'email_template_no_sanitize/wizard' |
502 | === added file 'email_template_no_sanitize/wizard/__init__.py' |
503 | --- email_template_no_sanitize/wizard/__init__.py 1970-01-01 00:00:00 +0000 |
504 | +++ email_template_no_sanitize/wizard/__init__.py 2014-06-19 22:33:02 +0000 |
505 | @@ -0,0 +1,1 @@ |
506 | +import compose_mail |
507 | |
508 | === added file 'email_template_no_sanitize/wizard/compose_mail.py' |
509 | --- email_template_no_sanitize/wizard/compose_mail.py 1970-01-01 00:00:00 +0000 |
510 | +++ email_template_no_sanitize/wizard/compose_mail.py 2014-06-19 22:33:02 +0000 |
511 | @@ -0,0 +1,137 @@ |
512 | +# -*- coding: utf-8 -*- |
513 | +############################################################################## |
514 | +# |
515 | +# OpenERP, Open Source Management Solution |
516 | +# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) |
517 | +# |
518 | +# This program is free software: you can redistribute it and/or modify |
519 | +# it under the terms of the GNU General Public License as published by |
520 | +# the Free Software Foundation, either version 3 of the License, or |
521 | +# (at your option) any later version. |
522 | +# |
523 | +# This program is distributed in the hope that it will be useful, |
524 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
525 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
526 | +# GNU General Public License for more details. |
527 | +# |
528 | +# You should have received a copy of the GNU General Public License |
529 | +# along with this program. If not, see <http://www.gnu.org/licenses/> |
530 | +# |
531 | +############################################################################## |
532 | + |
533 | +from openerp import SUPERUSER_ID |
534 | +import base64 |
535 | +from openerp.osv import osv |
536 | +from openerp.osv import fields |
537 | +from openerp.tools.translate import _ |
538 | + |
539 | + |
540 | +class mail_compose_message(osv.TransientModel): |
541 | + |
542 | + _inherit = 'mail.compose.message' |
543 | + |
544 | + def default_get(self, cr, uid, fields, context=None): |
545 | + if context is None: |
546 | + context = {} |
547 | + |
548 | + template_obj = self.pool.get('email.template') |
549 | + res = super(mail_compose_message, self).default_get(cr, uid, fields, context=context) |
550 | + template_brw = template_obj.browse(cr, uid, res.get('template_id'), |
551 | + context=context) |
552 | + if template_brw.special: |
553 | + values = self.generate_email_for_composer(cr, uid, |
554 | + res.get('template_id'), |
555 | + res.get('res_id'), |
556 | + context=context) |
557 | + |
558 | + res.update({'body_text':values.get('body', '')}) |
559 | + return res |
560 | + |
561 | + _columns = { |
562 | + 'body_text':fields.text('Body', help='Used to avoid the sanitize ' |
563 | + 'method and allow send ' |
564 | + 'custom template messages'), |
565 | + |
566 | + } |
567 | + |
568 | + def send_mail(self, cr, uid, ids, context=None): |
569 | + """ Process the wizard content and proceed with sending the related |
570 | + email(s), rendering any template patterns on the fly if needed. """ |
571 | + if context is None: |
572 | + context = {} |
573 | + ir_attachment_obj = self.pool.get('ir.attachment') |
574 | + mail_mail = self.pool.get('mail.mail') |
575 | + active_ids = context.get('active_ids') |
576 | + template_obj = self.pool.get('email.template') |
577 | + is_log = context.get('mail_compose_log', False) |
578 | + |
579 | + for wizard in self.browse(cr, uid, ids, context=context): |
580 | + temp_id = wizard.template_id |
581 | + template_brw = temp_id and template_obj.browse(cr, uid, temp_id, |
582 | + context=context) |
583 | + |
584 | + if template_brw and template_brw.special and wizard.body_text: |
585 | + attach_name = '%s.html' % template_brw.special_name |
586 | + mass_mail_mode = wizard.composition_mode == 'mass_mail' |
587 | + active_model_pool_name = wizard.model if wizard.model else 'mail.thread' |
588 | + active_model_pool = self.pool.get(active_model_pool_name) |
589 | + |
590 | + # wizard works in batch mode: [res_id] or active_ids |
591 | + res_ids = active_ids if mass_mail_mode and wizard.model and active_ids else [wizard.res_id] |
592 | + for res_id in res_ids: |
593 | + # mail.message values, according to the wizard options |
594 | + post_values = { |
595 | + 'subject': wizard.subject, |
596 | + 'body': '', |
597 | + 'parent_id': wizard.parent_id and wizard.parent_id.id, |
598 | + 'partner_ids': [partner.id for partner in wizard.partner_ids], |
599 | + 'attachment_ids': [attach.id for attach in wizard.attachment_ids], |
600 | + 'attachments': [], |
601 | + } |
602 | + # mass mailing: render and override default values |
603 | + if mass_mail_mode and wizard.model: |
604 | + email_dict = self.render_message(cr, uid, wizard, res_id, context=context) |
605 | + post_values['partner_ids'] += email_dict.pop('partner_ids', []) |
606 | + attachment_ids = [] |
607 | + for attach_id in post_values.pop('attachment_ids'): |
608 | + new_attach_id = ir_attachment_obj.copy(cr, uid, attach_id, {'res_model': self._name, 'res_id': wizard.id}, context=context) |
609 | + attachment_ids.append(new_attach_id) |
610 | + |
611 | + post_values['attachments'].append((attach_name, wizard.body_text.encode('utf-8'))) |
612 | + post_values['attachment_ids'] = attachment_ids |
613 | + post_values.update(email_dict) |
614 | + # post the message |
615 | + subtype = 'mail.mt_comment' |
616 | + post_values.update({'body': ''}) |
617 | + msg_id = active_model_pool.message_post(cr, uid, [res_id], type='notification', subtype=subtype, context=context, **post_values) |
618 | + attach_ids = ir_attachment_obj.search(cr, uid, |
619 | + [('res_model', '=', wizard.model), |
620 | + ('res_id', '=', res_id), |
621 | + ('name', '=', attach_name)], |
622 | + limit=1, |
623 | + order='id desc', |
624 | + context=context) |
625 | + |
626 | + self.pool.get('mail.notification')._notify(cr, uid, msg_id, post_values['partner_ids'], context=context) |
627 | + mail_id = mail_mail.create(cr, uid, |
628 | + { |
629 | + 'model': wizard.model, |
630 | + 'res_id': res_id, |
631 | + 'subject':wizard.subject, |
632 | + 'body_html': wizard.body_text, |
633 | + 'attachment_ids':[(6, 0, |
634 | + attach_ids)], |
635 | + 'auto_delete': True, |
636 | + }, context=context) |
637 | + mail_mail.send(cr, uid, [mail_id], |
638 | + recipient_ids=post_values.get('partner_ids'), |
639 | + context=context) |
640 | + # mass_mailing: notify specific partners, because subtype was False, and no-one was notified |
641 | + |
642 | + else: |
643 | + return super(mail_compose_message,self).send_mail(cr, uid, |
644 | + ids, context) |
645 | + |
646 | + |
647 | + return {'type': 'ir.actions.act_window_close'} |
648 | + |
649 | |
650 | === added file 'email_template_no_sanitize/wizard/compose_mail_view.xml' |
651 | --- email_template_no_sanitize/wizard/compose_mail_view.xml 1970-01-01 00:00:00 +0000 |
652 | +++ email_template_no_sanitize/wizard/compose_mail_view.xml 2014-06-19 22:33:02 +0000 |
653 | @@ -0,0 +1,16 @@ |
654 | +<?xml version="1.0" encoding="utf-8"?> |
655 | +<openerp> |
656 | + <data> |
657 | + <record model="ir.ui.view" id="email_compose_new_body_ink_template"> |
658 | + <field name="name">mail.compose.message.form</field> |
659 | + <field name="model">mail.compose.message</field> |
660 | + <field name="inherit_id" ref="mail.email_compose_message_wizard_form"/> |
661 | + <field name="arch" type="xml"> |
662 | + <xpath expr='//field[@name="body"]' position='after'> |
663 | + <field name="body_text" invisible='1'/> |
664 | + </xpath> |
665 | + </field> |
666 | + </record> |
667 | + |
668 | + </data> |
669 | +</openerp> |
670 | |
671 | === added directory 'email_template_no_sanitize/workflow' |