Khushboo Bhatt(openerp) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-1073886-kbh into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1073886 in OpenERP Addons: "State in done or waiting Payslip objects 
doesn't able to delete"
  https://bugs.launchpad.net/openobject-addons/+bug/1073886

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1073886-kbh/+merge/132650

Hello,

hr_payroll:
  Added method for deleting draft and cancel payslips.

Thanks,
Khushboo.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1073886-kbh/+merge/132650
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-1073886-kbh.
=== modified file 'hr_payroll/hr_payroll.py'
--- hr_payroll/hr_payroll.py	2012-10-12 11:42:58 +0000
+++ hr_payroll/hr_payroll.py	2012-11-02 06:17:19 +0000
@@ -363,6 +363,12 @@
     def check_done(self, cr, uid, ids, context=None):
         return True
 
+    def unlink(self, cr, uid, ids, context=None):
+        for payslip in self.browse(cr, uid, ids, context=context):
+            if payslip.state not in  ['draft','cancel']:
+                raise osv.except_osv(_('Warning!'),_('You cannot delete a payslip which is in %s state!')%(payslip.state))
+        return super(hr_payslip, self).unlink(cr, uid, ids, context)
+
     #TODO move this function into hr_contract module, on hr.employee object
     def get_contract(self, cr, uid, employee, date_from, date_to, context=None):
         """

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to