[IMP] website_link field removed

bzr revid: fp@tinyerp.com-20140413204625-tu2bw7cyj14rjx53
This commit is contained in:
Fabien Pinckaers 2014-04-13 22:46:25 +02:00
parent 57078f5c12
commit 3db3160644
2 changed files with 10 additions and 14 deletions

View 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',
}

View 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>