Merge lp:~camptocamp/c2c-addons/6.0-hr_timesheet_reminder-fix-lp1089390 into lp:c2c-addons/6.0

Proposed by Guewen Baconnier @ Camptocamp
Status: Needs review
Proposed branch: lp:~camptocamp/c2c-addons/6.0-hr_timesheet_reminder-fix-lp1089390
Merge into: lp:c2c-addons/6.0
Diff against target: 27 lines (+7/-8)
1 file modified
hr_timesheet_reminder/company.py (+7/-8)
To merge this branch: bzr merge lp:~camptocamp/c2c-addons/6.0-hr_timesheet_reminder-fix-lp1089390
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp code review, no test Approve
Review via email: mp+139627@code.launchpad.net

Commit message

FIX] never use a mutable in the second argument of fromkeys

Description of the change

To post a comment you must log in.
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM

review: Approve (code review, no test)

Unmerged revisions

65. By Guewen Baconnier @ Camptocamp <email address hidden> on 2012-12-13

[FIX] never use a mutable in the second argument of fromkeys

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_timesheet_reminder/company.py'
2--- hr_timesheet_reminder/company.py 2011-09-20 09:48:06 +0000
3+++ hr_timesheet_reminder/company.py 2012-12-13 08:19:25 +0000
4@@ -42,16 +42,15 @@
5
6 def get_reminder_recipients(self, cr, uid, ids, context=None):
7 """Return the list of users that must receive the email"""
8- res = {}.fromkeys(ids, [])
9+ res = dict((company_id, []) for company_id in ids)
10 employee_obj = self.pool.get('hr.employee')
11
12- companies = self.browse(cr, uid, ids, context=context)
13-
14- for company in companies:
15- employee_ids = employee_obj.search(cr, uid,
16- [('company_id', '=', company.id),
17- ('active', '=', True)],
18- context=context)
19+ for company in self.browse(cr, uid, ids, context=context):
20+ employee_ids = employee_obj.search(
21+ cr, uid,
22+ [('company_id', '=', company.id),
23+ ('active', '=', True)],
24+ context=context)
25 employees = employee_obj.browse(cr, uid, employee_ids, context=context)
26
27 #periods

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: