Post a copy in the document is False by default, and it does not make sense to replies in the document if the copy is not itself in the document. Therefore, if post a copy in the document is false by default, replies in the document should be false too. Moreover, reply_to is required in the form view if mass mailing mode and post a copy is false OR replies in the document is false But, to avoid updating the view, in the send_mail python function, if no reply to is set and post a copy or replies is false, we set the from email as the reply_to email bzr revid: dle@openerp.com-20140130102001-v4t8ig1sj3cpfy3b
92 lines
5.2 KiB
XML
92 lines
5.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<openerp>
|
|
<data>
|
|
<record model="ir.ui.view" id="email_compose_message_wizard_form">
|
|
<field name="name">mail.compose.message.form</field>
|
|
<field name="model">mail.compose.message</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Compose Email" version="7.0">
|
|
<group>
|
|
<!-- truly invisible fields for control and options -->
|
|
<field name="composition_mode" invisible="1"/>
|
|
<field name="model" invisible="1"/>
|
|
<field name="res_id" invisible="1"/>
|
|
<field name="parent_id" invisible="1"/>
|
|
<field name="mail_server_id" invisible="1"/>
|
|
<!-- Various warnings -->
|
|
<field name="use_active_domain" invisible="1"/>
|
|
<div colspan="2" class="oe_form_box_info oe_text_center"
|
|
attrs="{'invisible': [('use_active_domain', '!=', True)]}">
|
|
<p>
|
|
<strong>All records matching your current search filter will be mailed,
|
|
not only the ids selected in the list view.</strong><br />
|
|
If you want to work only with selected ids, please uncheck the
|
|
list header checkbox.
|
|
</p>
|
|
</div>
|
|
<!-- visible wizard -->
|
|
<field name="email_from"
|
|
attrs="{'invisible':[('composition_mode', '!=', 'mass_mail')]}"/>
|
|
<field name="subject" placeholder="Subject..." required="True"/>
|
|
<!-- classic message composer -->
|
|
<label for="partner_ids" string="Recipients"
|
|
attrs="{'invisible':[('composition_mode', '=', 'mass_mail')]}"/>
|
|
<div groups="base.group_user"
|
|
attrs="{'invisible':[('composition_mode', '=', 'mass_mail')]}">
|
|
<span attrs="{'invisible':[('model', '=', False)]}">
|
|
Followers of
|
|
<field name="record_name" readonly="1" class="oe_inline oe_compose_recipients"/>
|
|
and
|
|
</span>
|
|
<field name="partner_ids" widget="many2many_tags_email" placeholder="Add contacts to notify..."
|
|
context="{'force_email':True, 'show_email':True}"/>
|
|
</div>
|
|
<!-- mass post / mass mailing -->
|
|
<field name="post"
|
|
attrs="{'invisible':[('composition_mode', '!=', 'mass_mail')]}"/>
|
|
<field name="notify"
|
|
attrs="{'invisible':['|', ('post', '!=', True), ('composition_mode', '!=', 'mass_mail')]}"/>
|
|
<field name="same_thread"
|
|
attrs="{'invisible':['|', ('composition_mode', '!=', 'mass_mail'), ('post', '=', False)]}"/>
|
|
<field name="reply_to" placeholder="Email address te redirect replies..."
|
|
attrs="{'invisible':['|', '&', ('same_thread', '=', True), ('post', '=', True), ('composition_mode', '!=', 'mass_mail')],
|
|
'required':['&', '|', ('post', '=', False), ('same_thread', '=', False), ('composition_mode', '=', 'mass_mail')]}"/>
|
|
</group>
|
|
<field name="body"/>
|
|
<field name="attachment_ids" widget="many2many_binary" string="Attach a file"/>
|
|
<footer>
|
|
<button string="Send" name="send_mail" type="object" class="oe_highlight"/>
|
|
or
|
|
<button string="Cancel" class="oe_link" special="cancel" />
|
|
</footer>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_email_compose_message_wizard" model="ir.actions.act_window">
|
|
<field name="name">Compose Email</field>
|
|
<field name="res_model">mail.compose.message</field>
|
|
<field name="src_model">mail.compose.message</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="view_type">form</field>
|
|
<field name="view_mode">form</field>
|
|
<field name="target">new</field>
|
|
</record>
|
|
|
|
<!-- Replace the default mass-mailing wizard in base with the composition wizard -->
|
|
<act_window name="Partner Mass Mailing"
|
|
res_model="mail.compose.message"
|
|
src_model="res.partner"
|
|
view_mode="form"
|
|
multi="True"
|
|
target="new"
|
|
key2="client_action_multi"
|
|
id="base.action_partner_mass_mail"
|
|
context="{
|
|
'default_composition_mode': 'mass_mail',
|
|
'default_partner_to': '${object.id or \'\'}',
|
|
}"/>
|
|
|
|
</data>
|
|
</openerp>
|