Nehal Panchal (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-578933-nep into 
lp:openobject-addons/6.1.

Requested reviews:
  Naresh(OpenERP) (nch-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578933-nep/+merge/123733

Hello,

Unable to delete the employee.

Unlink() method of hr.employee is deleting a resource associated with an 
employee before deleting an employee. And so employee unlink() will work on 
resource which has already been deleted from database.

This fixes the issue.

Thanks.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578933-nep/+merge/123733
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-578933-nep.
=== modified file 'hr/hr.py'
--- hr/hr.py	2012-01-31 13:36:57 +0000
+++ hr/hr.py	2012-09-11 12:58:21 +0000
@@ -180,12 +180,12 @@
     def unlink(self, cr, uid, ids, context=None):
         resource_obj = self.pool.get('resource.resource')
         resource_ids = []
+        if resource_ids:
+            resource_obj.unlink(cr, uid, resource_ids, context=context)        
         for employee in self.browse(cr, uid, ids, context=context):
             resource = employee.resource_id
             if resource:
                 resource_ids.append(resource.id)
-        if resource_ids:
-            resource_obj.unlink(cr, uid, resource_ids, context=context)
         return super(hr_employee, self).unlink(cr, uid, ids, context=context)
 
     def onchange_address_id(self, cr, uid, ids, address, 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