Merge lp:~openerp-dev/openobject-addons/6.1-opw-584844-nep into lp:openobject-addons/6.1

Proposed by Nehal Panchal (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-584844-nep
Merge into: lp:openobject-addons/6.1
Diff against target: 16 lines (+6/-0)
1 file modified
hr_payroll/ (+6/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-584844-nep
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email:

Description of the change


You can delete the confirmed payslip.

This fixes the issue.


To post a comment you must log in.

Unmerged revisions

7139. By Nehal Panchal (OpenERP)

[FIX] hr_payroll : Fixed the issue for not allowing to delete done payslip

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_payroll/'
2--- hr_payroll/ 2012-01-31 13:36:57 +0000
3+++ hr_payroll/ 2013-01-31 09:11:44 +0000
4@@ -305,6 +305,12 @@
5 return True
7 _constraints = [(_check_dates, "Payslip 'Date From' must be before 'Date To'.", ['date_from', 'date_to'])]
9+ def unlink(self, cr, uid, ids, context=None):
10+ for payslip in self.browse(cr, uid, ids, context=context):
11+ if payslip.state not in ['draft','cancel']:
12+ raise osv.except_osv(_('Warning!'),_('You cannot delete a payslip which is not draft or cancelled!'))
13+ return super(hr_payslip, self).unlink(cr, uid, ids, context)
15 def copy(self, cr, uid, id, default=None, context=None):
16 if not default: