Merge lp:~camptocamp/hr-timesheet/6.1-hr_timesheet_reminder-fix-lp1089390 into lp:~hr-core-editors/hr-timesheet/6.1

Proposed by Guewen Baconnier @ Camptocamp
Status: Merged
Merge reported by: Joël Grand-Guillaume @ camptocamp
Merged at revision: not available
Proposed branch: lp:~camptocamp/hr-timesheet/6.1-hr_timesheet_reminder-fix-lp1089390
Merge into: lp:~hr-core-editors/hr-timesheet/6.1
Diff against target: 28 lines (+8/-8)
1 file modified
hr_timesheet_reminder/company.py (+8/-8)
To merge this branch: bzr merge lp:~camptocamp/hr-timesheet/6.1-hr_timesheet_reminder-fix-lp1089390
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp code review, no test Approve
Review via email: mp+139626@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)

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-01 13:44:19 +0000
3+++ hr_timesheet_reminder/company.py 2012-12-13 08:28:19 +0000
4@@ -42,16 +42,16 @@
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+
11 employee_obj = self.pool.get('hr.employee')
12
13- companies = self.browse(cr, uid, ids, context=context)
14-
15- for company in companies:
16- employee_ids = employee_obj.search(cr, uid,
17- [('company_id', '=', company.id),
18- ('active', '=', True)],
19- context=context)
20+ for company in self.browse(cr, uid, ids, context=context):
21+ employee_ids = employee_obj.search(
22+ cr, uid,
23+ [('company_id', '=', company.id),
24+ ('active', '=', True)],
25+ context=context)
26 employees = employee_obj.browse(cr, uid, employee_ids, context=context)
27
28 #periods

Subscribers

People subscribed via source and target branches

to all changes: