Files
odoo_source/addons/mass_mailing/views/email_template.xml
T
David Monjoie fda5021e6b [FIX] mass_mailing: added missing models in form view
In 9.0, we created a simplified form view for mail templates, in
which the model_id field is retricted to show only the models for
which mass mailing makes sense. However, two of those models were
forgotten. There should have been some sort of override in their
respective modules, but considering the nature of the domain
attributes, there is no easy way to write such overrides, which is
probably why there wasn't any override to begin with. We decided
with tde and al to just add these models in mass_mailing, thus
breaking module abstraction, but avoiding a very complex override
mechanism for a rather simple case like this.
2015-12-15 15:20:27 +01:00

96 lines
4.6 KiB
XML

<?xml version="1.0"?>
<openerp>
<data>
<!-- Email Templates -->
<record model="ir.ui.view" id="email_template_form_minimal">
<field name="name">email.template.form.minimal</field>
<field name="model">mail.template</field>
<field name="priority">32</field>
<field name="arch" type="xml">
<form string="Templates">
<sheet>
<div class="oe_button_box" name="button_box">
<button name="%(mail.wizard_email_template_preview)d" string="Preview"
type="action" target="new"
context="{'template_id':active_id}"/>
<br />
</div>
<group>
<group>
<field name="name" required="True"/>
<field name="model_id" required="1" options="{'no_open': True, 'no_create': True}"
domain="[('model', 'in', ['res.partner', 'mail.mass_mailing.contact', 'crm.lead', 'hr.applicant'])]"/>
<field name="model" invisible="True"/>
<field name="use_default_to" invisible="1"/>
</group>
</group>
<notebook>
<page string="Body">
<field name="body_html" nolabel="1" widget="html_frame" options="{'editor_url': '/mass_mailing/field/email_template'}"/>
<field name="attachment_ids" widget="many2many_binary"/>
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_email_template_kanban">
<field name="name">email.template.kanban</field>
<field name="model">mail.template</field>
<field name="arch" type="xml">
<kanban>
<field name="body_html"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_card oe_kanban_global_click oe_kanban_email_template">
<div t-if="widget.editable or widget.deletable" class="o_dropdown_kanban dropdown">
<a class="dropdown-toggle btn" data-toggle="dropdown" href="#" >
<span class="fa fa-bars fa-lg"/>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<t t-if="widget.editable">
<li><a type="edit">Edit</a></li>
</t>
<t t-if="widget.deletable">
<li><a type="delete">Delete</a></li>
</t>
</ul>
</div>
<div class="oe_kanban_content">
<h3>
<field name="name"/>
</h3>
<div class="kanban_html_preview">
<t t-raw="record.body_html.raw_value"/>
</div>
</div>
<div class="oe_clear"></div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record model="ir.actions.act_window" id="action_email_template_marketing">
<field name="name">Templates</field>
<field name="res_model">mail.template</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{
'form_view_ref': 'mass_mailing.email_template_form_minimal',
'default_use_default_to': True,
}</field>
</record>
<!-- Add Templates in Marketing / Mass mailing menu -->
<menuitem name="Mail Templates" id="menu_email_template"
parent="menu_mass_mailing_configuration" sequence="3"
action="action_email_template_marketing"/>
</data>
</openerp>