[MERGE] fix bug 791895 by jam

bzr revid: tfr@openerp.com-20110615094106-86xlk39qvlthl37e
This commit is contained in:
tfr@openerp.com 2011-06-15 11:41:06 +02:00
commit 94e35b57f5
1 changed files with 2 additions and 3 deletions

View File

@ -317,12 +317,11 @@ class project_scrum_meeting(osv.osv):
return True
def email_send(self, cr, uid, ids, email, context=None):
email_from = tools.config.get('email_from', False)
meeting_id = self.browse(cr, uid, ids, context=context)[0]
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
user_email = email_from or user.address_id.email or email_from
user_email = user.user_email or tools.config.get('email_from', False)
body = _("Hello %s,\n \nI am sending you Daily Meeting Details of date %s for the Sprint %s\n") %(meeting_id.sprint_id.scrum_master_id.name, meeting_id.date, meeting_id.sprint_id.name)
body += _('\n*Tasks since yesterday:\n_______________________%s\n*Task for Today:\n_______________________ %s\n\n*Blocks encountered:\n_______________________ %s') %(meeting_id.question_yesterday,meeting_id.question_today, meeting_id.question_blocks or _('No Blocks'))
body += _('\n* Tasks since yesterday:\n_______________________\n%s\n\n* Task for Today:\n_______________________ \n%s\n\n* Blocks encountered:\n_______________________ \n\n%s') %(meeting_id.question_yesterday,meeting_id.question_today, meeting_id.question_blocks or _('No Blocks'))
body += _("\n\nThank you,\n%s") % user.name
sub_name = meeting_id.name or _('Scrum Meeting of %s') % meeting_id.date
flag = tools.email_send(user_email , [email], sub_name, body, reply_to=None, openobject_id=str(meeting_id.id))