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>

[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
=== modified file 'hr_timesheet_reminder/company.py'
--- hr_timesheet_reminder/company.py 2011-09-20 09:48:06 +0000
+++ hr_timesheet_reminder/company.py 2012-12-13 08:19:25 +0000
@@ -42,16 +42,15 @@
4242
43 def get_reminder_recipients(self, cr, uid, ids, context=None):43 def get_reminder_recipients(self, cr, uid, ids, context=None):
44 """Return the list of users that must receive the email"""44 """Return the list of users that must receive the email"""
45 res = {}.fromkeys(ids, [])45 res = dict((company_id, []) for company_id in ids)
46 employee_obj = self.pool.get('hr.employee')46 employee_obj = self.pool.get('hr.employee')
4747
48 companies = self.browse(cr, uid, ids, context=context)48 for company in self.browse(cr, uid, ids, context=context):
4949 employee_ids = employee_obj.search(
50 for company in companies:50 cr, uid,
51 employee_ids = employee_obj.search(cr, uid,51 [('company_id', '=', company.id),
52 [('company_id', '=', company.id),52 ('active', '=', True)],
53 ('active', '=', True)],53 context=context)
54 context=context)
55 employees = employee_obj.browse(cr, uid, employee_ids, context=context)54 employees = employee_obj.browse(cr, uid, employee_ids, context=context)
5655
57 #periods56 #periods

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: