Merge lp:~openerp-dev/openobject-addons/6.0-opw-17109-nep into lp:openobject-addons/6.0

Proposed by Nehal Panchal (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-opw-17109-nep
Merge into: lp:openobject-addons/6.0
Diff against target: 31 lines (+6/-2)
1 file modified
hr_timesheet_sheet/hr_timesheet_sheet.py (+6/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-opw-17109-nep
Reviewer Review Type Date Requested Status
Anup(SerpentCS) (community) Approve
Nehal Panchal (OpenERP) (community) Needs Resubmitting
Review via email: mp+73030@code.launchpad.net

Description of the change

Hello,

From Human Resources > Attendances > Attendances the user was permitted to create new attendance entries into timesheets that were confirmed, validated or refused.

This fixes the issue by permitting entries only into draft or new timesheets.

Thanks.

To post a comment you must log in.
Revision history for this message
Nehal Panchal (OpenERP) (nep-openerp) :
review: Needs Resubmitting
4786. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4787. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4788. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4789. By Priyesh (OpenERP)

[MERGE] Merged My branch to fix the AssertionError of Fields in 'groupby' must appear in the list of fields to read(case:16819)

Revision history for this message
Nehal Panchal (OpenERP) (nep-openerp) :
review: Needs Resubmitting
4791. By Quentin (OpenERP) <email address hidden>

[FIX] sale: backport of revision 3164.118.785 from trunk branch, to fix picked rate on SO

4792. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4793. By Priyesh (OpenERP)

[MERGE] Merged RHA's branch to fix the problem of showing inactive employees in Holidays report per department.(case:17104)

4794. By Anup(SerpentCS)

[MERGE] thunderbird,outlook : Merged Ravi's branch for documentation link fix(Case:17190)

4795. By Anup(SerpentCS)

[MERGE] thunderbird : Merged Ravi's branch for thunderbird push mail with accented chars fix(Case:16766)

4796. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Valencia's branch for the fix of creation of menu from wiki group(case 17204)

4797. By Jay Vora (Serpent Consulting Services)

[FIX] Hr_payroll,hr_payroll_account : Corrected the views and used xpath tag

4798. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4799. By Priyesh (OpenERP)

[IMP] account_voucher: Fixed AttributeError: 'bool' object has no attribute 'replace' in the absenece of number and activated sequence in payment journal of Voucher(case:17229)

4800. By Antony Lesuisse (OpenERP)

[FIX] account journal create sequence with company_id

4801. By tfr (Openerp)

[FIX] Calendar invitation issue

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

[FIX] stock: allowed to set 0 as qty, otherwise if you ordered x PC1 and y PC2, and received only the PC1, then you have to delete the line with PC2 in the wizard. With that fix, you can just set it to 0

4803. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4804. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4805. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4806. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4807. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4808. By Anup(SerpentCS)

[Merge] Merged Valencia's branch for decimal precision fix(Case:17325)

4809. By Anup(SerpentCS)

[Merge] hr_timesheet_sheet : Merged Riken's branch for Timesheet's workflow correction(Case:17103)

4810. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4811. By Husen Daudi <hda@hda-laptop>

merged ach branch for issue opw-6306

4812. By Anup(SerpentCS)

[Merge] hr : Merged Nehal's branch for domain correction(Case:17165)

Revision history for this message
Anup(SerpentCS) (anup-serpent) wrote :

Hello Nehal,

Indeed this was needed.

Thanks for the fix.

review: Approve
4813. By Anup(SerpentCS)

[Merge] sale_layout : Merged Nehal's branch for translation fixes in report(Case:17286)

4814. By Anup(SerpentCS)

[Merge] hr_holidays : Merged Nehal's branch for fixing the workflow(Case:17349)

4815. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4816. By Jay Vora (Serpent Consulting Services)

[MERGE] Merged Amit's branch for the fix of RFQ report showing good format of Address

4817. By Jay Vora (Serpent Consulting Services)

[MERGE] Analytic : Fixed the problem of search()/name_search() on analytic account,project

4818. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4819. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4820. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4821. By Launchpad Translations on behalf of openerp

Launchpad automatic translations update.

4822. By Nehal Panchal (OpenERP)

[FIX] hr_timesheet_sheet : Restricts attendance entry in a confirmed and validated/refused timesheet

Unmerged revisions

4822. By Nehal Panchal (OpenERP)

[FIX] hr_timesheet_sheet : Restricts attendance entry in a confirmed and validated/refused timesheet

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_timesheet_sheet/hr_timesheet_sheet.py'
2--- hr_timesheet_sheet/hr_timesheet_sheet.py 2011-01-17 11:20:56 +0000
3+++ hr_timesheet_sheet/hr_timesheet_sheet.py 2011-09-14 07:40:52 +0000
4@@ -601,12 +601,16 @@
5 if 'sheet_id' in context:
6 ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id'], context=context)
7 if ts.state not in ('draft', 'new'):
8- raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet !'))
9+ raise osv.except_osv(_('Error !'), _('You cannot modify a timesheet entry in a confirmed or done timesheet!'))
10 res = super(hr_attendance,self).create(cr, uid, vals, context=context)
11 if 'sheet_id' in context:
12 if context['sheet_id'] != self.browse(cr, uid, res, context=context).sheet_id.id:
13 raise osv.except_osv(_('UserError'), _('You cannot enter an attendance ' \
14 'date outside the current timesheet dates!'))
15+ else:
16+ time_sheet_ids = self.pool.get('hr_timesheet_sheet.sheet').search(cr, uid, [('employee_id','=',vals['employee_id']),('date_to', '>=', vals['name']), ('date_from', '<=' ,vals['name']),('state', 'not in', ('draft', 'new'))])
17+ if time_sheet_ids:
18+ raise osv.except_osv(_('Error !'), _('You cannot modify a timesheet entry in a confirmed or done timesheet!'))
19 return res
20
21 def unlink(self, cr, uid, ids, *args, **kwargs):
22@@ -616,8 +620,8 @@
23 def write(self, cr, uid, ids, vals, context=None):
24 if context is None:
25 context = {}
26- self._check(cr, uid, ids)
27 res = super(hr_attendance,self).write(cr, uid, ids, vals, context=context)
28+ self._check(cr, uid, ids)
29 if 'sheet_id' in context:
30 for attendance in self.browse(cr, uid, ids, context=context):
31 if context['sheet_id'] != attendance.sheet_id.id: