Merge branch 'master' of https://github.com/odoo/odoo
[odoo/odoo.git] / addons / mail / wizard / mail_compose_message_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <record model="ir.ui.view" id="email_compose_message_wizard_form">
5             <field name="name">mail.compose.message.form</field>
6             <field name="model">mail.compose.message</field>
7             <field name="arch" type="xml">
8                 <form string="Compose Email">
9                     <group>
10                         <!-- truly invisible fields for control and options -->
11                         <field name="composition_mode" invisible="1"/>
12                         <field name="model" invisible="1"/>
13                         <field name="res_id" invisible="1"/>
14                         <field name="is_log" invisible="1"/>
15                         <field name="parent_id" invisible="1"/>
16                         <field name="mail_server_id" invisible="1"/>
17                         <!-- Various warnings -->
18                         <field name="use_active_domain" invisible="1"/>
19                         <div colspan="2" class="oe_form_box_info oe_text_center"
20                                 attrs="{'invisible': [('use_active_domain', '!=', True)]}">
21                             <p>
22                                 <strong>All records matching your current search filter will be mailed,
23                                     not only the ids selected in the list view.</strong><br />
24                                 If you want to work only with selected ids, please uncheck the
25                                 list header checkbox.
26                             </p>
27                         </div>
28                         <!-- visible wizard -->
29                         <field name="email_from"
30                             attrs="{'invisible':[('composition_mode', '!=', 'mass_mail')]}"/>
31                         <field name="subject" placeholder="Subject..." required="True"/>
32                         <!-- recipients -->
33                         <label for="partner_ids" string="Recipients"  attrs="{'invisible': [('is_log', '=', True)]}" groups="base.group_user"/>
34                         <div groups="base.group_user" attrs="{'invisible': [('is_log', '=', True)]}">
35                             <span attrs="{'invisible': [('composition_mode', '!=', 'mass_mail')]}">
36                                 <strong>Email mass mailing</strong> on
37                                 <span attrs="{'invisible': [('use_active_domain', '=', True)]}">the selected records</span>
38                                 <span attrs="{'invisible': [('use_active_domain', '=', False)]}">the current search filter</span>.
39                             </span>
40                             <span attrs="{'invisible':[('composition_mode', '!=', 'comment')]}">Followers of the document and</span>
41                             <field name="partner_ids" widget="many2many_tags_email" placeholder="Add contacts to notify..."
42                                 context="{'force_email':True, 'show_email':True}"
43                                 attrs="{'invisible': [('composition_mode', '!=', 'comment')]}"/>
44                         </div>
45                         <!-- mass post -->
46                         <field name="notify"
47                             attrs="{'invisible':['|', ('composition_mode', '!=', 'mass_post')]}"/>
48                         <!-- mass mailing -->
49                         <field name="no_auto_thread" attrs="{'invisible':[('composition_mode', '!=', 'mass_mail')]}"/>
50                         <field name="reply_to" placeholder="Email address to redirect replies..."
51                             attrs="{'invisible':['|', ('no_auto_thread', '=', False), ('composition_mode', '!=', 'mass_mail')],
52                                     'required':[('no_auto_thread', '=', True), ('composition_mode', '=', 'mass_mail')]}"/>
53                     </group>
54                     <field name="body"/>
55                     <field name="attachment_ids" widget="many2many_binary" string="Attach a file"/>
56                     <footer>
57                         <button string="Send" name="send_mail" type="object" class="oe_highlight"/>
58                         or
59                         <button string="Cancel" class="oe_link" special="cancel" />
60                     </footer>
61                 </form>
62             </field>
63         </record>
64
65         <record id="action_email_compose_message_wizard" model="ir.actions.act_window">
66             <field name="name">Compose Email</field>
67             <field name="res_model">mail.compose.message</field>
68             <field name="src_model">mail.compose.message</field>
69             <field name="type">ir.actions.act_window</field>
70             <field name="view_type">form</field>
71             <field name="view_mode">form</field>
72             <field name="target">new</field>
73         </record>
74
75         <!--  Replace the default mass-mailing wizard in base with the composition wizard -->
76         <act_window name="Partner Mass Mailing"
77                 res_model="mail.compose.message"
78                 src_model="res.partner"
79                 view_mode="form"
80                 multi="True"
81                 target="new"
82                 key2="client_action_multi"
83                 id="base.action_partner_mass_mail"
84                 context="{
85                             'default_composition_mode': 'mass_mail',
86                             'default_partner_to': '${object.id or \'\'}',
87                         }"/>
88
89     </data>
90 </openerp>