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/hr_payroll.py (+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: mp+145790@code.launchpad.net

Description of the change

Hello,

You can delete the confirmed payslip.

This fixes the issue.

Thanks

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
=== modified file 'hr_payroll/hr_payroll.py'
--- hr_payroll/hr_payroll.py 2012-01-31 13:36:57 +0000
+++ hr_payroll/hr_payroll.py 2013-01-31 09:11:44 +0000
@@ -305,6 +305,12 @@
305 return True305 return True
306306
307 _constraints = [(_check_dates, "Payslip 'Date From' must be before 'Date To'.", ['date_from', 'date_to'])] 307 _constraints = [(_check_dates, "Payslip 'Date From' must be before 'Date To'.", ['date_from', 'date_to'])]
308
309 def unlink(self, cr, uid, ids, context=None):
310 for payslip in self.browse(cr, uid, ids, context=context):
311 if payslip.state not in ['draft','cancel']:
312 raise osv.except_osv(_('Warning!'),_('You cannot delete a payslip which is not draft or cancelled!'))
313 return super(hr_payslip, self).unlink(cr, uid, ids, context)
308314
309 def copy(self, cr, uid, id, default=None, context=None):315 def copy(self, cr, uid, id, default=None, context=None):
310 if not default:316 if not default: