<?xml version="1.0"?>
<form string="Email message" duplicate="0">
                    <header>
                        <field name="message_type" invisible="1"/>
                        <button name="action_send_and_close" string="Send &amp; Close" type="object" class="oe_highlight" invisible="state != 'outgoing' or message_type == 'user_notification'"/>
                        <button name="mark_outgoing" string="Retry" type="object" invisible="state not in ('exception', 'cancel')"/>
                        <button name="cancel" string="Cancel" type="object" invisible="state != 'outgoing'"/>
                        <field name="state" widget="statusbar" statusbar_visible="outgoing,sent,received,exception,cancel"/>
                    </header>
                    <sheet>
                        <field name="model" invisible="1"/>
                        <field name="res_id" invisible="1"/>
                        <div class="oe_button_box" name="button_box">
                            <button name="action_open_document" type="object" class="oe_link" icon="fa-file-text-o" invisible="not model or res_id == 0">
                                    <div class="o_field_widget o_stat_info">
                                        <span class="o_stat_text">Open Document</span>
                                    </div>
                            </button>
                        </div>
                        <field name="mail_message_id_int" required="0" invisible="1"/>
                        <div class="oe_title">
                            <label for="subject" class="oe_edit_only"/>
                            <h2><field name="subject"/></h2>
                        </div>
                        <div style="vertical-align: top;">
                            by <field name="author_id" class="oe_inline" string="User"/> on <field name="date" readonly="1" class="oe_inline"/>
                            <button name="101" string="Reply" type="action" icon="fa-reply text-warning" context="{'default_composition_mode':'comment', 'default_parent_id': mail_message_id_int}" invisible="state not in ('received', 'sent', 'exception', 'cancel')"/>
                        </div>
                        <group>
                            <field name="email_from"/>
                            <field name="email_to"/>
                            <field name="recipient_ids" widget="many2many_tags" domain="[('active', '=', True)]"/>
                            <field name="email_cc"/>
                            <field name="reply_to"/>
                            <field name="scheduled_date" placeholder="YYYY-MM-DD HH:MM:SS"/>
                        </group>
                        <notebook>
                            <page string="Body" name="body">
                                <field name="body_content"/>
                            </page>
                            <page string="Advanced" name="advanced" groups="base.group_no_one">
                                <group>
                                    <group string="Status">
                                        <field name="auto_delete" invisible="state != 'outgoing' and state != 'exception'"/>
                                        <field name="is_notification"/>
                                        <field name="message_type"/>
                                        <field name="mail_server_id"/>
                                        <field name="model"/>
                                        <field name="res_id"/>
                                    </group>
                                    <group string="Headers">
                                        <field name="message_id"/>
                                        <field name="references"/>
                                        <field name="fetchmail_server_id"/>
                                        <field name="headers"/>
                                    </group>
                                </group>
                            </page>
                            <page string="Attachments" name="attachments">
                                <div class="alert alert-warning" role="alert" invisible="restricted_attachment_count == 0">
                                    You do not have access to <field name="restricted_attachment_count"/>
                                    attachment(s) of this email.
                                </div>
                                <field name="unrestricted_attachment_ids" domain="[('res_field','=', False)]"/>
                            </page>
                            <page string="Failure Reason" name="failure_reason" invisible="state != 'exception'">
                                <field name="failure_reason"/>
                            </page>
                        </notebook>
                    </sheet>
                </form>
            