Merge lp:~vauxoo/addons-vauxoo/jose-fix-expired-task into lp:addons-vauxoo/7.0

Status: Needs review
Proposed branch: lp:~vauxoo/addons-vauxoo/jose-fix-expired-task
Merge into: lp:addons-vauxoo/7.0
Diff against target: 23 lines (+3/-3)
1 file modified
expired_task_information/model/task.py (+3/-3)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/jose-fix-expired-task

Description of the change

Added user_id like search parameter because, the task must have a user to send a mail

To post a comment you must log in.

Unmerged revisions

1057. By Jose Antonio Morales Ponce(vauxoo) - - http://www.vauxoo.com

[FIX] Added user_id like search parameter because, the task must have a user to send a mail

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'expired_task_information/model/task.py'
2--- expired_task_information/model/task.py 2014-05-09 21:51:34 +0000
3+++ expired_task_information/model/task.py 2014-06-17 17:24:53 +0000
4@@ -83,8 +83,8 @@
5 before_expiry = before_expiry.strftime('%Y-%m-%d')
6 last_change = last_change.strftime('%Y-%m-%d')
7 task_ids = task_obj.search(cr, uid,
8- [('state', 'not in',
9- ('done', 'cancelled'))],
10+ [('state', 'not in', ('done', 'cancelled')),
11+ ('user_id', '!=', False)],
12 context=context)
13 for task in task_ids and task_obj.browse(cr, uid, task_ids):
14 msg_expired = ''
15@@ -602,7 +602,7 @@
16 'body_html': html,
17 'auto_delete': True,
18 }, context=context)
19- mail_mail.send(cr, uid, [mail_id],
20+ task.user_id and mail_mail.send(cr, uid, [mail_id],
21 recipient_ids=[task.user_id.partner_id.id],
22 context=context)
23 return True