<?xml version="1.0"?>
<openerp>
    <data>

<!-- Send New Mail view -->

        <record model="ir.ui.view" id="crm_send_new_mail_view">
            <field name="name">crm.new.send.mail.form</field>
            <field name="model">crm.send.mail</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Send Mail" col="4">
                    <group colspan="4" col="2">
                    <field name="email_from"/>
                    <field name="reply_to"/>
                    <field name="email_to" />
                    <field name="email_cc"/>
                    <field name="subject"/>
                    </group>
                    <notebook colspan="6">
                        <page string="Message">
                            <field name="body" nolabel="1" colspan="4" default_focus="1"/>
                        </page>
                        <page string="Attachments">
                            <field name="attachment_ids" colspan="4" nolabel="1">
                                <form string="Attachment">
                                    <field name="binary" filename="name" />
                                    <field name="name" />
                                </form>
                                <tree string="Attachments">
                                    <field name="name" />
                                </tree>
                            </field>
                        </page>
                    </notebook>
                    <separator string="" colspan="6"/>
                    <group colspan="6" col="4" >
                        <field name="state" />
                        <button string="_Cancel" icon="gtk-cancel" special="cancel" />
                        <button name="action_send" type="object" string="_Send" icon="gtk-go-forward" />
                    </group>
                </form>
            </field>
        </record>

<!-- Send New Mail action -->

        <record model="ir.actions.act_window" id="action_crm_send_mail">
            <field name="name">Send Mail</field>
            <field name="res_model">crm.send.mail</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="crm_send_new_mail_view"/>
            <field name="target">new</field>
        </record>


    <!-- Reply to Mail view -->

        <record model="ir.ui.view" id="crm_reply_mail_view">
            <field name="name">crm.mail.reply.form</field>
            <field name="model">crm.send.mail</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Reply to last Mail" col="2">
                    <field name="email_from" />
                    <field name="email_to" />
                    <field name="email_cc" />
                    <field name="subject" />
                    <field name="attachment_ids" colspan="4" nolabel="1">
                        <form string="Attachment">
                            <field name="binary" filename="name" />
                            <field name="name" />
                        </form>
                        <tree string="Attachments">
                            <field name="name" />
                        </tree>
                    </field>
                    <separator string="" colspan="4"/>
                    <field name="body" nolabel="1" colspan="4"/>
                    <separator string=" " colspan="4"/>
                    <group colspan="4" col="3" >
                        <label string=" " />
                        <button string="_Cancel" icon="gtk-cancel" special="cancel" />
                        <button name="action_send" type="object" string="_Send Reply" icon="gtk-go-forward" />
                    </group>
                </form>
            </field>
        </record>

<!-- Reply to Mail action -->

        <record model="ir.actions.act_window" id="action_crm_reply_mail">
            <field name="name">Reply to last Mail</field>
            <field name="res_model">crm.send.mail</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="crm_reply_mail_view"/>
            <field name="target">new</field>
        </record>

    </data>
</openerp>
