Merge lp:~openerp-dev/openobject-addons/trunk-bug-1085787-rma into lp:openobject-addons

Proposed by Randhir Mayatra (OpenERP)
Status: Rejected
Rejected by: Victor Tabuenca (OpenERP)
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-1085787-rma
Merge into: lp:openobject-addons
Diff against target: 12 lines (+1/-1)
1 file modified
hr/hr.py (+1/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-1085787-rma
Reviewer Review Type Date Requested Status
Victor Tabuenca (OpenERP) (community) Disapprove
Review via email: mp+137781@code.launchpad.net

Description of the change

Hello Sir,
  I have fix the problem of delete employee in hr.

Thank you.

To post a comment you must log in.
Revision history for this message
Victor Tabuenca (OpenERP) (vta-openerp) wrote :

Looking to the method's code:
  - I think it doesn't make sense to test the existence of the required field 'resource_id') and,
  - the definition of the field 'resource_id' ('ondelete=cascade')

In my opinion, unlinking the resource should be enough (just let the RDBS to do its job).

Although the patch kind of fixes the bug, because it returns before the call to unlink an employee already deleted by the RDBS (calling super is the cause of the traceback), I think it's more appropriate to fix the method's code in a more suitable manner.

I reject the proposal.

review: Disapprove

Unmerged revisions

8193. By Randhir Mayatra (OpenERP)

[FIX] solve the error while delete employee in hr

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 2012-11-13 15:03:37 +0000
3+++ hr/hr.py 2012-12-04 09:31:23 +0000
4@@ -229,7 +229,7 @@
5 if resource:
6 resource_ids.append(resource.id)
7 if resource_ids:
8- resource_obj.unlink(cr, uid, resource_ids, context=context)
9+ return resource_obj.unlink(cr, uid, resource_ids, context=context)
10 return super(hr_employee, self).unlink(cr, uid, ids, context=context)
11
12 def onchange_address_id(self, cr, uid, ids, address, context=None):

Subscribers

People subscribed via source and target branches

to all changes: