Files
odoo_source/addons/mail/mail_message_view.xml
T
Olivier Dony 16a8811930 [IMP] mail,email_template: improved views, assert missing email_from
- add missing colspans for notebooks
- remove some buttons from mail.message form view,
  namely because send button can cause record deletion
  possibly causing some weird UI result.. better used
  from the list view for now (web was fixed anyway)
- better domain on Message action, to ease debugging
- added assert for email_from in email_template.send_email()
  to catch errors earlier

bzr revid: odo@openerp.com-20120213143531-eiuhulo46bv059pl
2012-02-13 15:35:31 +01:00

150 lines
8.9 KiB
XML

<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_email_message_form">
<field name="name">mail.message.form</field>
<field name="model">mail.message</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Email message">
<group colspan="4" col="6">
<field name="subject" colspan="4"/>
<field name="date"/>
<field name="user_id" string="User"/>
<field name="partner_id" readonly="1" attrs="{'invisible':[('partner_id', '=', False)]}"/>
</group>
<notebook colspan="4">
<page string="Details">
<group col="2" colspan="2">
<separator string="Recipients" colspan="4"/>
<field name="email_from"/>
<field name="email_to"/>
<field name="email_cc" attrs="{'invisible':[('email_cc', '=', False)]}"/>
<field name="email_bcc" groups="base.group_extended" attrs="{'invisible':[('email_bcc', '=', False)]}"/>
<field name="reply_to" attrs="{'invisible':[('reply_to', '=', False)]}"/>
</group>
<group col="4" colspan="2">
<separator string="Message Details" colspan="4"/>
<field name="model"/>
<button name="open_document" string="Open" type="object" icon="gtk-jump-to" colspan="2"/>
<field name="res_id" groups="base.group_extended"/>
<field name="message_id" groups="base.group_extended" colspan="4" attrs="{'invisible':[('message_id', '=', False)]}"/>
<field name="references" colspan="4" widget="char" size="512" groups="base.group_extended" attrs="{'invisible':[('references', '=', False)]}"/>
</group>
<notebook colspan="4">
<page string="Body (Rich)" attrs="{'invisible':[('subtype','=','plain')]}">
<field name="body_html" widget="text_html" nolabel="1" colspan="4"/>
</page>
<page string="Body (Plain)">
<field name="body_text" colspan="4" widget="text" nolabel="1"/>
</page>
</notebook>
<separator string="" colspan="4"/>
<group col="6" colspan="4">
<field name="state" colspan="2"/>
<group col="4" colspan="2">
<button name="%(action_email_compose_message_wizard)d" string="Reply" type="action" icon="terp-mail-replied"
context="{'mail.compose.message.mode':'reply', 'message_id':active_id}" states='received,sent,exception,cancel'/>
</group>
</group>
</page>
<page string="Attachments">
<separator string="Attachments" colspan="4"/>
<field name="attachment_ids" nolabel="1" colspan="4"/>
</page>
<page string="Advanced" groups="base.group_extended">
<group col="2" colspan="4">
<field name="mail_server_id" attrs="{'invisible':[('mail_server_id', '=', False)]}"/>
<field name="subtype" attrs="{'invisible':[('subtype', '=', False)]}"/>
<field name="auto_delete"/>
<field name="headers" colspan="4" attrs="{'invisible':[('headers', '=', False)]}"/>
<field name="original" colspan="4" attrs="{'invisible':[('original', '=', False)]}"/>
</group>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_email_message_tree">
<field name="name">mail.message.tree</field>
<field name="model">mail.message</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Emails" colors="grey:state in ('sent', 'cancel');blue:state=='outgoing';red:state=='exception';black:state=='received'">
<field name="date"/>
<field name="subject"/>
<field name="email_from"/>
<field name="user_id" string="User"/>
<field name="message_id" invisible="1"/>
<field name="partner_id" invisible="1"/>
<field name="state"/>
<button name="send" string="Send Now" type="object" icon="gtk-media-play" states='outgoing'/>
<button name="mark_outgoing" string="Retry" type="object" icon="gtk-redo" states='exception,cancel'/>
<button name="cancel" string="Cancel" type="object" icon="terp-gtk-stop" states='outgoing'/>
<button name="open_document" string="Open Related Document" type="object" icon="gtk-jump-to"/>
<button name="open_attachment" string="Open Attachments" type="object" icon="gtk-jump-to"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_email_message_search">
<field name="name">mail.message.search</field>
<field name="model">mail.message</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Email Search">
<filter icon="terp-camera_test" name="received" string="Received" domain="[('state','=','received')]"/>
<filter icon="terp-call-start" name="outgoing" string="Outgoing" domain="[('state','=','outgoing')]"/>
<filter icon="terp-check" name="sent" string="Sent" domain="[('state','=','sent')]"/>
<separator orientation="vertical"/>
<filter icon="terp-gtk-stop" string="Failed" domain="[('state','=','exception')]"/>
<field name="email_from"/>
<field name="email_to"/>
<field name="subject"/>
<field name="date"/>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="user_id" string="User"/>
<field name="partner_id" string="Partner Name"/>
</group>
<newline/>
<group expand="0" string="Group By..." groups="base.group_extended">
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Thread" icon="terp-mail-" domain="[]" context="{'group_by':'message_id'}"/>
<separator orientation="vertical"/>
<filter string="Month" help="Creation Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
</group>
</search>
</field>
</record>
<record id="action_view_mail_message" model="ir.actions.act_window">
<field name="name">Messages</field>
<field name="res_model">mail.message</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">['|',('state','in',['outgoing','exception']),('email_from', '!=', False)]</field>
<field name="search_view_id" ref="view_email_message_search"/>
</record>
<act_window domain="[('partner_id', '=', active_id), ('email_from', '!=', False)]"
context="{'default_partner_id': active_id}"
id="act_res_partner_emails" name="Emails"
res_model="mail.message"
src_model="res.partner"
view_id="view_email_message_tree"/>
<menuitem name="Messages"
id="menu_email_message"
parent="base.menu_email"
action="action_view_mail_message" />
</data>
</openerp>