Merge lp:~vauxoo/addons-vauxoo/jose-custom-template into lp:addons-vauxoo/7.0

Status: Superseded
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

This proposal has been superseded by a proposal from 2014-06-19.

Description of the change

Custom Template

To post a comment you must log in.
1042. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com

[IMP] Validate the second body of the html message

1043. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com

[ADD] Added a demo template in partner model

1044. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com

[IMP] Rename module and change description

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
=== added directory 'email_template_no_sanitize'
=== added file 'email_template_no_sanitize/__init__.py'
--- email_template_no_sanitize/__init__.py 1970-01-01 00:00:00 +0000
+++ email_template_no_sanitize/__init__.py 2014-06-19 22:07:56 +0000
@@ -0,0 +1,2 @@
1import wizard
2import model
03
=== added file 'email_template_no_sanitize/__openerp__.py'
--- email_template_no_sanitize/__openerp__.py 1970-01-01 00:00:00 +0000
+++ email_template_no_sanitize/__openerp__.py 2014-06-19 22:07:56 +0000
@@ -0,0 +1,70 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21{
22 'name' : 'Email Template without Sanitized',
23 'version' : '0.1',
24 'author' : 'Vauxoo',
25 'category' : '',
26 'description' : """
27Email Templates Without Sanitize
28================
29- When you need to create a custom template with the email.template model
30 and add some cool features to your template at the moment that you try to
31 send it you see that the sanitize method of openerp changes all your
32 template and became to a different template. To avoid this problem we
33 created this module.
34
35How to Use
36==========
37- In the template view we add 2 new fields in the Advanced page. The first
38 field is a boolean, used to define the template like important, this makes
39 that template's content will not be sanitize.
40
41- The second field is a string, where you define the name of the attachment
42 generated when you send your custom template, because the custom template
43 will generate an attachment and puts it in the message post of the model
44 """,
45 'website': 'http://www.vauxoo.com',
46 'images' : [],
47 'depends' : [
48 'mail',
49 'email_template',
50 ],
51 'data': [
52 'wizard/compose_mail_view.xml',
53 'view/email_template_view.xml',
54 ],
55 'js': [
56 ],
57 'qweb' : [
58 ],
59 'css':[
60 ],
61 'demo': [
62 'demo/custom_template_demo.xml',
63 ],
64 'test': [
65 ],
66 'installable': True,
67 'auto_install': False,
68}
69# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
70
071
=== added directory 'email_template_no_sanitize/data'
=== added directory 'email_template_no_sanitize/demo'
=== added file 'email_template_no_sanitize/demo/custom_template_demo.xml'
--- email_template_no_sanitize/demo/custom_template_demo.xml 1970-01-01 00:00:00 +0000
+++ email_template_no_sanitize/demo/custom_template_demo.xml 2014-06-19 22:07:56 +0000
@@ -0,0 +1,328 @@
1<?xml version="1.0"?>
2<openerp>
3 <!-- Mail template is done in a NOUPDATE block
4 so users can freely customize/delete them -->
5 <data noupdate="1">
6 <!--Email template Post training -->
7 <record id="email_template_custom" model="email.template">
8 <field name="name">Custom Template Demo</field>
9 <field name="email_to">${(object.user_id.email or '')|safe}</field>
10 <field name="email_from"></field>
11 <field name="reply_to"></field>
12 <field name="subject">Important Information</field>
13 <field name="model_id" ref="base.model_res_partner"/>
14 <field name="special" eval="True"/>
15 <field name="special_name">Partner</field>
16 <field name="auto_delete" eval="True"/>
17 <field name="lang">${object.lang}</field>
18 <field name="body_html">
19 <![CDATA[
20<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
21<html xmlns="http://www.w3.org/1999/xhtml">
22<head>
23<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
24<title></title>
25
26<style type="text/css">
27
28@media only screen and (max-width: 500px) {
29 html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; }
30 .mobile-width{width:320px!important;}
31 .hide{display:none;}
32 .header-image{width:380px!important; height:137px!important;}
33 .float-left{float:left; border-top:none!important;}
34 .float-right{float:right;}
35 .banner-ad-top{padding-top:20px!important; padding-bottom:20px!important; padding-left:92px!important; padding-right:0!important;}
36 .banner-ad-middle{padding-top:0!important; padding-bottom:0!important; padding-left:92px!important; padding-right:0!important;}
37 .banner-ad-bottom{padding-top:20px!important; padding-bottom:20px!important; padding-left:92px!important; padding-right:0!important;}
38 .consultant-info{padding-right:0!important; border-right:none!important;}
39 .more-icons-top{padding:20px 20px 0 20px!important;}
40 .more-icons-bottom{border-top:none!important; padding:20px 20px 0 20px!important;}
41 .more-icons-title{padding:0 20px 20px 20px!important;}
42 .more-icons-text{padding:0 20px!important;}
43}
44
45</style>
46
47</head>
48
49<body style="margin:0;" rightmargin="0" leftmargin="0" topmargin="0" bottommargin="0" bgcolor="#ffffff">
50
51<table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="#ffffff" text="#373737">
52 <tbody>
53 <tr>
54 <td>
55 <!-- START Main Container -->
56 <table width="625" class="mobile-width" cellspacing="0" cellpadding="0" border="0" align="center">
57 <thead>
58 <tr>
59<h1>Hi ${object.name}</h1>
60 <!-- START Subject Line -->
61 <td colspan="2" style="padding:5px 10px;" bgcolor="#ffffff">
62 <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>
63 </td>
64 <td colspan="2" style="padding:5px 10px;" align="right" bgcolor="#ffffff" valign="middle" class="hide">
65 <!--<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 &raquo;</a></p>-->
66 <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 &raquo;</a>
67 </td>
68 <!-- END Subject Line -->
69 </tr>
70 <tr>
71 <!-- START Header -->
72 <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">
73 <table cellspacing="0" cellpadding="0" border="0" width="605" class="mobile-width">
74 <tbody>
75 <tr>
76 <td align="right" style="padding:10px 0;" height="60" width="205" class="hide">
77 <table cellspacing="0" cellpadding="0" border="0" width="205">
78 <tr>
79 <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>
80 <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>
81 </tr>
82 <tr>
83 <td colspan="2" align="right">
84 </td>
85 </tr>
86 </table>
87 </td>
88 </tr>
89 </tbody>
90 </table>
91 </td>
92 <!-- END Header -->
93 </tr>
94 <tr class="hide">
95 <!-- START Nav -->
96 <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>
97 <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>
98 <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>
99 <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>
100 <!-- END Nav -->
101 </tr>
102 </thead>
103 <tbody>
104 <tr>
105 <!-- START Hero Image -->
106 <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>
107 <!-- END Hero Image -->
108 </tr>
109 <tr>
110 <!-- START Main Copy -->
111 <td colspan="4" bgcolor="#eeeeee" style="padding:20px; border-bottom:1px solid #cccccc;" class="mobile-width">
112 <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>
113 <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>
114 <table cellspacing="0" cellpadding="0" border="0" width="565" class="mobile-width">
115 <tbody>
116 <tr>
117 <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>
118 <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>
119 </tr>
120 <tr>
121 <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>
122 <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>
123 </tr>
124 <tr>
125 <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>
126 <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>
127 </tr>
128 </tbody>
129 </table>
130 <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>
131
132 <div><!--[if mso]>
133 <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">
134 <v:fill type="tile" src="http://www.cruiseshipcenters.com/csflash/ECSC/img/red-button.gif" color="#c60000" />
135 <w:anchorlock/>
136 <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">See Details</center>
137 </v:roundrect>
138<![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>
139 </td>
140 <!-- END Main Copy -->
141 </tr>
142 <tr>
143 <!-- START Consultant Info -->
144 <td colspan="4" bgcolor="#eeeeee" style="border-bottom:1px solid #cccccc;" class="mobile-width">
145 <table cellspacing="0" cellpadding="0" border="0" width="625" class="mobile-width">
146 <tbody>
147 <tr>
148 <td style="background:#eeeeee; padding-top:20px; padding-bottom:20px; padding-left:20px; border-top:1px solid #ffffff;" width="116">
149 <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;"/>
150 </td>
151 <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>
152 <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>
153
154 <div><!--[if mso]>
155 <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">
156 <v:fill type="tile" src="http://www.cruiseshipcenters.com/csflash/ECSC/img/blue-button.gif" color="#0083d2" />
157 <w:anchorlock/>
158 <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">Get Assistance</center>
159 </v:roundrect>
160<![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>
161
162 <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">
163 <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>
164 <table cellspacing="0" cellpadding="0" border="0" width="185">
165 <tbody>
166 <tr>
167 <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>
168 </tr>
169 <tr>
170 <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>
171 </tr>
172 <tr>
173 <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>
174 </tr>
175 <tr>
176 <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>
177 </tr>
178 <tr>
179 <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>
180 </tr>
181 </tbody>
182 </table>
183 </td>
184
185 </tr>
186 </tbody>
187 </table>
188 </td>
189 <!-- END Consultant Info -->
190 </tr>
191 <tr>
192 <!-- START Custom Promotion -->
193 <td colspan="4" bgcolor="#eeeeee" style="border-bottom:1px solid #cccccc; border-top:1px solid #ffffff;" class="mobile-width">
194 <table cellspacing="0" cellpadding="0" border="0" width="625" class="mobile-width">
195 <tbody>
196 <tr>
197 <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>
198 <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>
199 <div><!--[if mso]>
200 <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">
201 <v:fill type="tile" src="http://www.cruiseshipcenters.com/csflash/ECSC/img/red-button.gif" color="#c60000" />
202 <w:anchorlock/>
203 <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">See Details</center>
204 </v:roundrect>
205<![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>
206 </tr>
207 </tbody>
208 </table>
209 </td>
210 <!-- END Custom Promotion -->
211 </tr>
212 <tr>
213 <!-- START Banner Ads -->
214 <td colspan="4" style="border-bottom:1px solid #cccccc;" bgcolor="#C0D9E8" class="mobile-width">
215 <table cellspacing="0" cellpadding="0" border="0" width="625" class="mobile-width">
216 <tbody>
217 <tr>
218 <td style="padding:20px; border-top:1px solid #ffffff;" class="float-left banner-ad-top" align="center">
219 <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>
220 </td>
221 <td style="padding:20px 0; border-top:1px solid #ffffff;" class="float-left banner-ad-middle">
222 <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>
223 </td>
224 <td style="padding:20px; border-top:1px solid #ffffff;" class="float-left banner-ad-bottom">
225 <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>
226 </td>
227 </tr>
228 </tbody>
229 </table>
230 </td>
231 <!-- END Banner Ads -->
232 </tr>
233 <tr>
234 <!-- START Banner Ad -->
235 <td colspan="4" bgcolor="#eeeeee" class="mobile-width">
236 <table cellspacing="0" cellpadding="0" border="0" width="625" class="mobile-width">
237 <tbody>
238 <tr>
239 <td class="float-left">
240 <table cellspacing="0" cellpadding="0" border="0" class="mobile-width">
241 <tbody>
242 <tr>
243 <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>
244 <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>
245 <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>
246 </tr>
247 <tr>
248 <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>
249 <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>
250 <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>
251 </tbody>
252 </table>
253 </td>
254 <td valign="top" class="float-left">
255 <table cellspacing="0" cellpadding="0" border="0" class="mobile-width">
256 <tbody>
257 <tr>
258 <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>
259 <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>
260 <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>
261 </tr>
262 <tr>
263 <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>
264 <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>
265 <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>
266 </tr>
267 </tbody>
268 </table>
269 </td>
270 </tr>
271
272 <tr>
273 <td colspan="6" style="padding-left:130px; padding-right:130px;" align="center" class="more-icons-text">
274 <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>
275 </td>
276 </tr>
277 <tr>
278 <td colspan="6" style="padding-bottom:20px;" align="center">
279 <div><!--[if mso]>
280 <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">
281 <v:fill type="tile" src="http://www.cruiseshipcenters.com/csflash/ECSC/img/blue-button.gif" color="#0083d2" />
282 <w:anchorlock/>
283 <center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">Get Assistance</center>
284 </v:roundrect>
285<![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>
286 </tr>
287 </tbody>
288 </table>
289 </td>
290 <!-- END Banner Ad -->
291 </tr>
292 <tr>
293 <!-- START Legal Info -->
294 <td colspan="4" bgcolor="#ffffff" style="padding:20px;" class="mobile-width">
295 <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>
296 </td>
297 <!-- END Legal Info -->
298 </tr>
299 </tbody>
300 <tfoot>
301 <tr>
302 <!-- START Footer -->
303 <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">
304 <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>
305 <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>
306 <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>
307 <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>
308 </td>
309 <!-- END Footer -->
310 </tr>
311 </tfoot>
312 </table><!-- END Main Container -->
313 </td>
314 </tr>
315 </tbody>
316</table>
317</body>
318</html>]]>
319 </field>
320 </record>
321
322 <!-- Create Action to test at same time the method create_action -->
323
324 <function name="create_action" model="email.template">
325 <value eval="[ref('email_template_custom')]"/>
326 </function>
327 </data>
328</openerp>
0329
=== added directory 'email_template_no_sanitize/i18n'
=== added directory 'email_template_no_sanitize/model'
=== added file 'email_template_no_sanitize/model/__init__.py'
--- email_template_no_sanitize/model/__init__.py 1970-01-01 00:00:00 +0000
+++ email_template_no_sanitize/model/__init__.py 2014-06-19 22:07:56 +0000
@@ -0,0 +1,1 @@
1import email_template
02
=== added file 'email_template_no_sanitize/model/email_template.py'
--- email_template_no_sanitize/model/email_template.py 1970-01-01 00:00:00 +0000
+++ email_template_no_sanitize/model/email_template.py 2014-06-19 22:07:56 +0000
@@ -0,0 +1,45 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>
19#
20##############################################################################
21
22from openerp import SUPERUSER_ID
23from openerp.osv import osv
24from openerp.osv import fields
25from openerp.tools.translate import _
26
27
28class email_template(osv.Model):
29
30 _inherit = 'email.template'
31
32 _columns = {
33
34 'special':fields.boolean('Special Template',
35 help='Used to define this template like '
36 'special, and avoid sanitize its '
37 'content'),
38 'special_name':fields.char('Name of file to send', 64,
39 help='The special templates generate an '
40 'attachment, with this field you '
41 'define the name of these '
42 'attachments'),
43
44
45 }
046
=== added directory 'email_template_no_sanitize/security'
=== added directory 'email_template_no_sanitize/view'
=== added file 'email_template_no_sanitize/view/email_template_view.xml'
--- email_template_no_sanitize/view/email_template_view.xml 1970-01-01 00:00:00 +0000
+++ email_template_no_sanitize/view/email_template_view.xml 2014-06-19 22:07:56 +0000
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record model="ir.ui.view" id="email_template_ink_template">
5 <field name="name">email.template</field>
6 <field name="model">email.template</field>
7 <field name="inherit_id" ref="email_template.email_template_form"/>
8 <field name="arch" type="xml">
9 <xpath expr='//field[@name="auto_delete"]' position='before'>
10 <field name="special"/>
11 <field name="special_name" attrs="{'invisible':[('special', '=', False)], 'required':[('special', '=', True)]}"/>
12 </xpath>
13 </field>
14 </record>
15
16 </data>
17</openerp>
018
=== added directory 'email_template_no_sanitize/wizard'
=== added file 'email_template_no_sanitize/wizard/__init__.py'
--- email_template_no_sanitize/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ email_template_no_sanitize/wizard/__init__.py 2014-06-19 22:07:56 +0000
@@ -0,0 +1,1 @@
1import compose_mail
02
=== added file 'email_template_no_sanitize/wizard/compose_mail.py'
--- email_template_no_sanitize/wizard/compose_mail.py 1970-01-01 00:00:00 +0000
+++ email_template_no_sanitize/wizard/compose_mail.py 2014-06-19 22:07:56 +0000
@@ -0,0 +1,137 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>
19#
20##############################################################################
21
22from openerp import SUPERUSER_ID
23import base64
24from openerp.osv import osv
25from openerp.osv import fields
26from openerp.tools.translate import _
27
28
29class mail_compose_message(osv.TransientModel):
30
31 _inherit = 'mail.compose.message'
32
33 def default_get(self, cr, uid, fields, context=None):
34 if context is None:
35 context = {}
36
37 template_obj = self.pool.get('email.template')
38 res = super(mail_compose_message, self).default_get(cr, uid, fields, context=context)
39 template_brw = template_obj.browse(cr, uid, res.get('template_id'),
40 context=context)
41 if template_brw.special:
42 values = self.generate_email_for_composer(cr, uid,
43 res.get('template_id'),
44 res.get('res_id'),
45 context=context)
46
47 res.update({'body_text':values.get('body', '')})
48 return res
49
50 _columns = {
51 'body_text':fields.text('Body', help='Used to avoid the sanitize '
52 'method and allow send '
53 'custom template messages'),
54
55 }
56
57 def send_mail(self, cr, uid, ids, context=None):
58 """ Process the wizard content and proceed with sending the related
59 email(s), rendering any template patterns on the fly if needed. """
60 if context is None:
61 context = {}
62 ir_attachment_obj = self.pool.get('ir.attachment')
63 mail_mail = self.pool.get('mail.mail')
64 active_ids = context.get('active_ids')
65 template_obj = self.pool.get('email.template')
66 is_log = context.get('mail_compose_log', False)
67
68 for wizard in self.browse(cr, uid, ids, context=context):
69 temp_id = wizard.template_id
70 template_brw = temp_id and template_obj.browse(cr, uid, temp_id,
71 context=context)
72
73 if template_brw and template_brw.special and wizard.body_text:
74 attach_name = '%s.html' % template_brw.special_name
75 mass_mail_mode = wizard.composition_mode == 'mass_mail'
76 active_model_pool_name = wizard.model if wizard.model else 'mail.thread'
77 active_model_pool = self.pool.get(active_model_pool_name)
78
79 # wizard works in batch mode: [res_id] or active_ids
80 res_ids = active_ids if mass_mail_mode and wizard.model and active_ids else [wizard.res_id]
81 for res_id in res_ids:
82 # mail.message values, according to the wizard options
83 post_values = {
84 'subject': wizard.subject,
85 'body': '',
86 'parent_id': wizard.parent_id and wizard.parent_id.id,
87 'partner_ids': [partner.id for partner in wizard.partner_ids],
88 'attachment_ids': [attach.id for attach in wizard.attachment_ids],
89 'attachments': [],
90 }
91 # mass mailing: render and override default values
92 if mass_mail_mode and wizard.model:
93 email_dict = self.render_message(cr, uid, wizard, res_id, context=context)
94 post_values['partner_ids'] += email_dict.pop('partner_ids', [])
95 attachment_ids = []
96 for attach_id in post_values.pop('attachment_ids'):
97 new_attach_id = ir_attachment_obj.copy(cr, uid, attach_id, {'res_model': self._name, 'res_id': wizard.id}, context=context)
98 attachment_ids.append(new_attach_id)
99
100 post_values['attachments'].append((attach_name, wizard.body_text.encode('utf-8')))
101 post_values['attachment_ids'] = attachment_ids
102 post_values.update(email_dict)
103 # post the message
104 subtype = 'mail.mt_comment'
105 post_values.update({'body': ''})
106 msg_id = active_model_pool.message_post(cr, uid, [res_id], type='notification', subtype=subtype, context=context, **post_values)
107 attach_ids = ir_attachment_obj.search(cr, uid,
108 [('res_model', '=', wizard.model),
109 ('res_id', '=', res_id),
110 ('name', '=', attach_name)],
111 limit=1,
112 order='id desc',
113 context=context)
114
115 self.pool.get('mail.notification')._notify(cr, uid, msg_id, post_values['partner_ids'], context=context)
116 mail_id = mail_mail.create(cr, uid,
117 {
118 'model': wizard.model,
119 'res_id': res_id,
120 'subject':wizard.subject,
121 'body_html': wizard.body_text,
122 'attachment_ids':[(6, 0,
123 attach_ids)],
124 'auto_delete': True,
125 }, context=context)
126 mail_mail.send(cr, uid, [mail_id],
127 recipient_ids=post_values.get('partner_ids'),
128 context=context)
129 # mass_mailing: notify specific partners, because subtype was False, and no-one was notified
130
131 else:
132 return super(mail_compose_message,self).send_mail(cr, uid,
133 ids, context)
134
135
136 return {'type': 'ir.actions.act_window_close'}
137
0138
=== added file 'email_template_no_sanitize/wizard/compose_mail_view.xml'
--- email_template_no_sanitize/wizard/compose_mail_view.xml 1970-01-01 00:00:00 +0000
+++ email_template_no_sanitize/wizard/compose_mail_view.xml 2014-06-19 22:07:56 +0000
@@ -0,0 +1,16 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record model="ir.ui.view" id="email_compose_new_body_ink_template">
5 <field name="name">mail.compose.message.form</field>
6 <field name="model">mail.compose.message</field>
7 <field name="inherit_id" ref="mail.email_compose_message_wizard_form"/>
8 <field name="arch" type="xml">
9 <xpath expr='//field[@name="body"]' position='after'>
10 <field name="body_text" invisible='1'/>
11 </xpath>
12 </field>
13 </record>
14
15 </data>
16</openerp>
017
=== added directory 'email_template_no_sanitize/workflow'