[IMP] mail: improvements in email.message view and rename the sortcut 'Attachments' as 'Messages' for fetchmail form view and also changed domain for that

bzr revid: rha@tinyerp.com-20110405122510-2udrv4a7pfa7446u
This commit is contained in:
Rifakat Haradwala (Open ERP) 2011-04-05 17:55:10 +05:30
parent f3d727379e
commit 8ae0447cc0
3 changed files with 23 additions and 9 deletions

View File

@ -143,7 +143,7 @@
<act_window
context="{'search_default_server_id': [active_id], 'default_server_id': active_id}"
id="act_server_history" name="Emails"
id="act_server_history" name="Messages" domain="[('history', '=', True), ('server_id', '=', active_id)]"
res_model="email.message" src_model="email.server"/>
</data>

View File

@ -182,6 +182,7 @@ class email_message(osv.osv):
('sent', 'Sent'),
('received', 'Received'),
('exception', 'Exception'),
('cancel', 'Cancelled'),
], 'State', readonly=True),
'auto_delete': fields.boolean('Auto Delete', help="Permanently delete emails after sending"),
}
@ -336,6 +337,13 @@ class email_message(osv.osv):
self.write(cr, uid, [message.id], {'state':'exception'}, context)
return False
return True
def do_cancel(self, cr, uid, ids, context=None):
'''
Cancel the email to be send
'''
self.write(cr, uid, ids, {'state':'cancel'}, context)
return True
# OLD Code.
# def send_all_mail(self, cr, uid, ids=None, context=None):
# if ids is None:

View File

@ -40,12 +40,16 @@
</group>
<separator string="Description" colspan="4"/>
<field name="body" nolabel="1" colspan="4"/>
<group col="4" colspan="4">
<separator string="" colspan="4"/>
<field name="state" attrs="{'invisible': [('state', '==', False)]}"/>
<button name="%(action_email_compose_message_wizard)d" string="Reply" type="action" icon="terp-mail-replied"
context="{'mail':'reply', 'message_id':active_id}" colspan="2"/>
<button name="process_email_queue" string="Force send" type="object" icon="gtk-execute" states='exception' colspan="2"/>
<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':'reply', 'message_id':active_id}" states='received,outgoing,sent,exception,cancel'/>
<button name="send_email" string="Force Send" type="object" icon="gtk-execute" states='outgoing'/>
<button name="process_retry" string="Send Again" type="object" icon="gtk-execute" states='exception,cancel'/>
<button name="do_cancel" string="Cancel" type="object" icon="terp-gtk-stop" states='outgoing'/>
</group>
</group>
</page>
<page string="Attachments">
@ -73,7 +77,7 @@
<field name="model">email.message</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Emails">
<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"/>
@ -94,7 +98,8 @@
<field name="arch" type="xml">
<search string="Email Search">
<separator orientation="vertical"/>
<filter icon="terp-call-start" string="Waiting" domain="[('state','=','waiting')]"/>
<filter icon="terp-camera_test" string="Received" domain="[('state','=','received')]"/>
<filter icon="terp-call-start" name="outgoing" string="Outgoing" domain="[('state','=','outgoing')]"/>
<filter icon="terp-gtk-stop" string="Exception" domain="[('state','=','exception')]"/>
<field name="email_from"/>
<field name="subject"/>
@ -121,6 +126,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('history', '=', True)]</field>
<field name="context">{'search_default_outgoing':1}</field>
<field name="search_view_id" ref="view_email_message_search"/>
</record>