[IMP]: crm: Improvement in add cc wizard, improved view

bzr revid: rpa@tinyerp.com-20100503071308-t2rr2xc1z5ykssqz
This commit is contained in:
rpa (Open ERP)
2010-05-03 12:43:08 +05:30
parent f341e4dda7
commit c89de179f5
2 changed files with 8 additions and 3 deletions
+4 -1
View File
@@ -51,7 +51,7 @@ class crm_email_add_cc_wizard(osv.osv_memory):
email = False
if partner:
addr = self.pool.get('res.partner').address_get(cr, uid, [partner], ['contact'])
if addr:
if addr and addr['contact']:
email = self.pool.get('res.partner.address').read(cr, uid, addr['contact'] , ['email'])['email']
elif user:
addr = self.pool.get('res.users').read(cr, uid, user, ['address_id'])['address_id']
@@ -101,6 +101,9 @@ class crm_email_add_cc_wizard(osv.osv_memory):
raise osv.except_osv(_('Email Fail!'), ("Lastest Email is not sent successfully"))
return {}
def action_cancel(self, cr, uid, ids, context=None):
return {'type' : 'ir.actions.act_window_close'}
crm_email_add_cc_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+4 -2
View File
@@ -8,7 +8,8 @@
<field name="model">crm.email.add.cc</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Forward">
<form string="Send mail to CC">
<separator colspan="4" string="Send mail to CC" />
<field name="name" width="200" />
<field name="subject" colspan="4" />
<separator colspan="4" string="" />
@@ -26,7 +27,8 @@
</group>
<field colspan="4" name="email" attrs="{ 'required' : [('name','=','email')]}" />
<separator colspan="4" string="" />
<group col="1" colspan="4">
<group col="2" colspan="4">
<button name="action_cancel" special="cancel" string="Cancel" icon="gtk-cancel" type="object" />
<button name="add_cc" string="_Forward" type="object" icon="gtk-ok" />
</group>
</form>