Merge lp:~openerp-dev/openobject-addons/trunk-bug-769632-ara into lp:openobject-addons

Proposed by Ashvin Rathod (OpenERP)
Status: Merged
Merged at revision: 4669
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-769632-ara
Merge into: lp:openobject-addons
Diff against target: 21 lines (+11/-0)
1 file modified
hr/hr.py (+11/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-769632-ara
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Approve
qdp (OpenERP) Pending
Review via email: mp+59044@code.launchpad.net

Description of the change

Hello,

Fix: HR-Removing Administrator employee record causes future updates of hr module to fail

Thanks,
ara

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr/hr.py'
2--- hr/hr.py 2011-04-07 09:27:30 +0000
3+++ hr/hr.py 2011-04-26 11:31:05 +0000
4@@ -161,6 +161,17 @@
5 'passport_id':fields.char('Passport No', size=64)
6 }
7
8+ def unlink(self, cr, uid, ids, context=None):
9+ resource_obj = self.pool.get('resource.resource')
10+ resource_ids = []
11+ for employee in self.browse(cr, uid, ids, context=context):
12+ resource = employee.resource_id
13+ if resource:
14+ resource_ids.append(resource.id)
15+ if resource_ids:
16+ resource_obj.unlink(cr, uid, resource_ids, context=context)
17+ return super(hr_employee, self).unlink(cr, uid, ids, context=context)
18+
19 def onchange_address_id(self, cr, uid, ids, address, context=None):
20 if address:
21 address = self.pool.get('res.partner.address').browse(cr, uid, address, context=context)

Subscribers

People subscribed via source and target branches

to all changes: