[IMP] website_link field removed
authorFabien Pinckaers <fp@tinyerp.com>
Sun, 13 Apr 2014 20:46:25 +0000 (22:46 +0200)
committerFabien Pinckaers <fp@tinyerp.com>
Sun, 13 Apr 2014 20:46:25 +0000 (22:46 +0200)
bzr revid: fp@tinyerp.com-20140413204625-tu2bw7cyj14rjx53

addons/website_mail/models/email_template.py
addons/website_mail/views/email_template_view.xml

index 64beace..2cd6a7a 100644 (file)
@@ -25,14 +25,12 @@ from openerp.tools.translate import _
 
 class EmailTemplate(osv.Model):
     _inherit = 'email.template'
-
-    def _get_website_link(self, cr, uid, ids, name, args, context=None):
-        return dict((id, _('<a href="website_mail/email_designer?model=email.template&res_id=%d">Open with visual editor</a>') % id) for id in ids)
-
-    _columns = {
-        'website_link': fields.function(
-            _get_website_link, type='text',
-            string='Website Link',
-            help='Link to the website',
-        ),
-    }
+    def action_edit_html(self, cr, uid, ids, name, args, context=None):
+        assert len(ids)==1, "One and only one ID allowed for this action"
+        url = '/website_mail/email_designer?model=email.template&res_id=%d&field_body=body_html&field_from=email_form&field_subject=name' % (ids[0],)
+        return {
+            'name': _('Edit Template'),
+            'type': 'ir.actions.act_url',
+            'url': url,
+            'target': 'self',
+        }
index 295002a..522730e 100644 (file)
@@ -7,9 +7,7 @@
             <field name="inherit_id" ref="email_template.email_template_form"/>
             <field name="arch" type="xml">
                 <xpath expr="//h1" position="after">
-                    <br />
-                    <field name="website_link" widget='html' radonly='1'
-                        style='margin: 0px; padding: 0px;'/>
+                    <button string="Edit Template" name="action_edit_html" type="object"/>
                 </xpath>
             </field>
         </record>