diff --git a/addons/crm/wizard/crm_email_add_cc.py b/addons/crm/wizard/crm_email_add_cc.py index 9af1b5eda5d..f3a10b36ef2 100644 --- a/addons/crm/wizard/crm_email_add_cc.py +++ b/addons/crm/wizard/crm_email_add_cc.py @@ -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: diff --git a/addons/crm/wizard/crm_email_add_cc_view.xml b/addons/crm/wizard/crm_email_add_cc_view.xml index 7c6ea96df23..b017c9d9901 100644 --- a/addons/crm/wizard/crm_email_add_cc_view.xml +++ b/addons/crm/wizard/crm_email_add_cc_view.xml @@ -8,7 +8,8 @@ crm.email.add.cc form -
+ + @@ -26,7 +27,8 @@ - + +