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
=== modified file 'hr_attendance/hr_attendance.py'
--- hr_attendance/hr_attendance.py 2012-01-31 13:36:57 +0000
+++ hr_attendance/hr_attendance.py 2012-08-23 05:54:25 +0000
@@ -66,7 +66,7 @@
66 def _altern_si_so(self, cr, uid, ids, context=None):66 def _altern_si_so(self, cr, uid, ids, context=None):
67 """ Alternance sign_in/sign_out check.67 """ Alternance sign_in/sign_out check.
68 Previous (if exists) must be of opposite action.68 Previous (if exists) must be of opposite action.
69 Next (if exists) must be of opposite action.69 Next (if exists and on the same day) must be of opposite action.
70 """70 """
71 for att in self.browse(cr, uid, ids, context=context):71 for att in self.browse(cr, uid, ids, context=context):
72 # search and browse for first previous and first next records72 # search and browse for first previous and first next records
@@ -75,11 +75,15 @@
75 prev_atts = self.browse(cr, uid, prev_att_ids, context=context)75 prev_atts = self.browse(cr, uid, prev_att_ids, context=context)
76 next_atts = self.browse(cr, uid, next_add_ids, context=context)76 next_atts = self.browse(cr, uid, next_add_ids, context=context)
77 # check for alternance, return False if at least one condition is not satisfied77 # check for alternance, return False if at least one condition is not satisfied
78 if prev_atts and prev_atts[0].action == att.action: # previous exists and is same action78 if prev_atts and prev_atts[0].action == att.action:
79 return False79 # previous exists and is same action
80 if next_atts and next_atts[0].action == att.action: # next exists and is same action80 return False
81 return False81 if next_atts and next_atts[0].action == att.action and next_atts[0].day == att.day:
82 if (not prev_atts) and (not next_atts) and att.action != 'sign_in': # first attendance must be sign_in82 # next exists and is same action on the same day;
83 # this allows to "fix attendances" by adding attendances on a former day
84 return False
85 if (not prev_atts) and (not next_atts) and att.action != 'sign_in':
86 # first attendance must be sign_in
83 return False87 return False
84 return True88 return True
8589