Merge lp:~openerp-dev/openobject-addons/6.1-opw-577297-rha into lp:openobject-addons/6.1

Proposed by Rifakat Husen (OpenERP)
Status: Approved
Approved by: Naresh(OpenERP)
Approved revision: 6961
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-577297-rha
Merge into: lp:openobject-addons/6.1
Diff against target: 32 lines (+10/-6)
1 file modified
hr_attendance/hr_attendance.py (+10/-6)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-577297-rha
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Approve
Review via email: mp+120100@code.launchpad.net

Description of the change

Hello,

Currently it is not possible to fill the attendance of some days before from
current date. User end up with warning.

Steps to reproduce:
* Suppose I have filled all my attendance till 17th August 2012
  except 14th August.
* If I try to create attendance of 14th, it raises warning and doesn't
  let me fill it.

Please review this fix.

Regards,
Rifakat Haradwala

To post a comment you must log in.
6952. By Olivier Dony (Odoo)

[MERGE] OPW 578181: fix missing column in hr.holiday list, making group by date_from fail miserably

6953. By Quentin (OpenERP) <email address hidden>

[FIX] account_voucher: supplier payment, accounting entry generation

6954. By Xavier ALT

[MERGE] OPW 576484: account: fix invoice residual, avoid adding multiple times residual for same partial reconcile

6955. By Xavier ALT

[MERGE] OPW 577014: email_template: for not force mass_mail in mail.compose.message wizard, if user is working on a single resource

6956. By Xavier ALT

[MERGE] OPW 576491: edi + email_template: correctly generate edi_web_view_url when sending email from mail.compose.message wizard

 * edi: improve generation/usage of edi_web_url_view for template rendering

   - wrap edi_web_url_view generation to _edi_get_object_web_url_view() method.
   - automatically add 'edi_web_url_view' to all email.template rendering context

   - introduce LazyEdiWebUrlViewGetter class, to allow resolving record wihtin
     template rendering context - only when necessary. This to prevent generating
     unrequested edi_web_url_view links

 * mail & email_template: allow to modify render_template context

   - add _prepare_render_template_context() method to allow modifying context
     before rendering template.

6957. By Quentin (OpenERP) <email address hidden>

[MERGE] fixes in account_voucher

6958. By Xavier ALT

[FIX] OPW 577963: ir_attachment: speed up ir.attachment search for large databases

6959. By Olivier Dony (Odoo)

[FIX] document: complete previous fix, restore sort order after filtering

6960. By Xavier ALT

[MERGE] BUG 1039664: edi: fix wrong cursor when generating edi_web_url_view

  regression from revid: <email address hidden>

6961. By Rifakat Husen (OpenERP)

[FIX] hr_attendance: improved code by directly using 'day' field, also improved doc string, (Courtesy to Raphael Collet)

Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-577297-port-mma/+merge/132533 and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6961. By Rifakat Husen (OpenERP)

[FIX] hr_attendance: improved code by directly using 'day' field, also improved doc string, (Courtesy to Raphael Collet)

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 2012-01-31 13:36:57 +0000
3+++ hr_attendance/hr_attendance.py 2012-08-23 05:54:25 +0000
4@@ -66,7 +66,7 @@
5 def _altern_si_so(self, cr, uid, ids, context=None):
6 """ Alternance sign_in/sign_out check.
7 Previous (if exists) must be of opposite action.
8- Next (if exists) must be of opposite action.
9+ Next (if exists and on the same day) must be of opposite action.
10 """
11 for att in self.browse(cr, uid, ids, context=context):
12 # search and browse for first previous and first next records
13@@ -75,11 +75,15 @@
14 prev_atts = self.browse(cr, uid, prev_att_ids, context=context)
15 next_atts = self.browse(cr, uid, next_add_ids, context=context)
16 # check for alternance, return False if at least one condition is not satisfied
17- if prev_atts and prev_atts[0].action == att.action: # previous exists and is same action
18- return False
19- if next_atts and next_atts[0].action == att.action: # next exists and is same action
20- return False
21- if (not prev_atts) and (not next_atts) and att.action != 'sign_in': # first attendance must be sign_in
22+ if prev_atts and prev_atts[0].action == att.action:
23+ # previous exists and is same action
24+ return False
25+ if next_atts and next_atts[0].action == att.action and next_atts[0].day == att.day:
26+ # next exists and is same action on the same day;
27+ # this allows to "fix attendances" by adding attendances on a former day
28+ return False
29+ if (not prev_atts) and (not next_atts) and att.action != 'sign_in':
30+ # first attendance must be sign_in
31 return False
32 return True
33