39
39
context = context or {}
40
40
#Dont send context to dont get language of user in read method
41
#@ids in v8 is not a dictionary
42
#@stage deprecated in v8 by odoo
43
#~ if ids.get('stage_id'): #comment while is migrate to v8 this module
44
if {}.get('stage_id'):
45
type = self.pool.get('project.task.type').read(cr, uid, ids['stage_id'][0], ['name'])
46
if type.get('name', False) == 'Backlog':
47
self.send_mail_task(cr,uid,ids,'template_send_email_task_new',context)
48
elif type.get('name', False) == 'Testing Leader':
49
self.send_mail_task(cr,uid,ids,'template_send_email_task_end',context)
42
type = ids.stage_id.name or ''
44
self.send_mail_task(cr, uid, ids, 'template_send_email_task_new', context)
45
elif type == 'Testing Leader':
46
self.send_mail_task(cr, uid, ids, 'template_send_email_task_end', context)
51
def send_mail_task(self,cr,uid,ids,template,context=None):
48
def send_mail_task(self, cr, uid, ids, template, context=None):
52
49
imd_obj = self.pool.get('ir.model.data')
53
50
template_ids = imd_obj.search(
54
51
cr, uid, [('model', '=', 'email.template'), ('name', '=', template)])
56
53
res_id = imd_obj.read(
57
54
cr, uid, template_ids, ['res_id'])[0]['res_id']
59
followers = self.read(cr, uid, ids.get('id'), [
56
followers = self.read(cr, uid, ids[0], [
60
57
'message_follower_ids'])['message_follower_ids']
63
59
body_html = self.pool.get('email.template').read(
64
60
cr, uid, res_id, ['body_html']).get('body_html')
65
61
context.update({'default_template_id': res_id,