Merge lp:~openerp-dev/openobject-addons/trunk-bug-1223230-ssh into lp:openobject-addons

Proposed by Sunil Sharma(OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1223230-ssh
Merge into: lp:openobject-addons
Diff against target: 27 lines (+5/-1)
2 files modified
hr_attendance/hr_attendance.py (+4/-0)
hr_attendance/test/attendance_process.yml (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1223230-ssh
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+202449@code.launchpad.net

Description of the change

Hello,

       I have fix this bug, It is impossible to import attendances for same day at same time as previous data .

Thanks
Sunil Sharma (SSH)

To post a comment you must log in.

Unmerged revisions

9060. By Sunil Sharma(OpenERP)

[imp]:improve yml test case

9059. By Sunil Sharma(OpenERP)

[FIX]:hr_attendance:It is Impossible to same day at same time as more then one sign_in or sign_out

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_attendance/hr_attendance.py'
2--- hr_attendance/hr_attendance.py 2013-10-27 12:31:04 +0000
3+++ hr_attendance/hr_attendance.py 2014-01-21 13:05:38 +0000
4@@ -80,6 +80,10 @@
5 return False
6 if (not prev_atts) and (not next_atts) and att.action != 'sign_in': # first attendance must be sign_in
7 return False
8+ #It is Impossible to same day at same time as more then one sign_in or sign_out
9+ new_add_ids = self.search(cr, uid, [('employee_id', '=', att.employee_id.id), ('name', '=', att.name), ('action', 'in', ('sign_in','sign_out'))])
10+ if len(new_add_ids) > 1 :
11+ return False
12 return True
13
14 _constraints = [(_altern_si_so, 'Error ! Sign in (resp. Sign out) must follow Sign out (resp. Sign in)', ['action'])]
15
16=== modified file 'hr_attendance/test/attendance_process.yml'
17--- hr_attendance/test/attendance_process.yml 2013-10-27 12:31:04 +0000
18+++ hr_attendance/test/attendance_process.yml 2014-01-21 13:05:38 +0000
19@@ -53,7 +53,7 @@
20 -
21 !record {model: hr.attendance, id: hr_attendance_0}:
22 employee_id: hr.employee_niv
23- name: !eval time.strftime('%Y-%m-%d 09:59:25')
24+ name: !eval time.strftime('%Y-%m-%d 09:59:26')
25 action: 'sign_in'
26 -
27 Now Employee is going to Sign In prior to First Sign In.

Subscribers

People subscribed via source and target branches

to all changes: