[FIX]: fix a problem for the browse object

crm.case->crm.lead

bzr revid: mga@tinyerp.com-20100203110828-gsh3j1g6b3a5xxeh
This commit is contained in:
Mantavya Gajjar
2010-02-03 16:38:28 +05:30
parent f1c3bbe555
commit 2f352b9335
@@ -110,13 +110,18 @@ def _mass_mail_send(self, cr, uid, data, context):
def _get_info(self, cr, uid, data, context):
if not data['id']:
return {}
pool = pooler.get_pool(cr.dbname)
case = pool.get('crm.case').browse(cr,uid,data['ids'])[0]
#if not case.email_from:
# raise wizard.except_wizard(_('Error'),_('You must put a Partner eMail to use this action!'))
case = pool.get('crm.lead').browse(cr, uid, data['id'])
if not case.user_id:
raise wizard.except_wizard(_('Error'),_('You must define a responsible user for this case in order to use this action!'))
return {'to': case.email_from,'subject': case.name,'cc': case.email_cc or ''}
return {
'to': case.email_from,
'subject': case.name,
'cc': case.email_cc or ''
}
class wizard_send_mail(wizard.interface):
states = {