[6.1]Error on Employee unlink

Bug #1049199 reported by Hugo Santos (Factorlibre)
52
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP Publisher's Warranty Team
Therp Backports (Deprecated)
Status tracked in Addons-6.1
Addons-6.1
Fix Released
High
Stefan Rijnhart (Opener)
Addons-7.0
New
Undecided
Unassigned

Bug Description

With the last revision of OpenERP Server http://bazaar.launchpad.net/~openerp/openobject-server/6.1/revision/4268 I obtain an error if I unlink an employee.

Client Traceback (most recent call last):
  File "/home/hugo/openerp/sources/6.1/modules/web/common/http.py", line 180, in dispatch
    response["result"] = method(controller, self, **self.params)
  File "/home/hugo/openerp/sources/6.1/modules/web/controllers/main.py", line 1044, in call
    return self.call_common(req, model, method, args, domain_id, context_id)
  File "/home/hugo/openerp/sources/6.1/modules/web/controllers/main.py", line 996, in call_common
    return self._call_kw(req, model, method, args, {})
  File "/home/hugo/openerp/sources/6.1/modules/web/controllers/main.py", line 1010, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/home/hugo/openerp/sources/6.1/modules/web/common/openerplib/main.py", line 250, in proxy
    args, kw)
  File "/home/hugo/openerp/sources/6.1/modules/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/home/hugo/openerp/sources/6.1/modules/web/common/http.py", line 608, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)

Server Traceback (most recent call last):
  File "/home/hugo/openerp/sources/6.1/modules/web/common/http.py", line 593, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/home/hugo/openerp/sources/6.1/openobject-server/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/home/hugo/openerp/sources/6.1/openobject-server/openerp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/home/hugo/openerp/sources/6.1/openobject-server/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/home/hugo/openerp/sources/6.1/openobject-server/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/hugo/openerp/sources/6.1/openobject-server/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/hugo/openerp/sources/6.1/openobject-server/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/home/hugo/openerp/sources/6.1/modules/hr/hr.py", line 189, in unlink
    return super(hr_employee, self).unlink(cr, uid, ids, context=context)
  File "/home/hugo/openerp/sources/6.1/openobject-server/openerp/osv/orm.py", line 3726, in unlink
    result_store = self._store_get_values(cr, uid, ids, self._all_columns.keys(), context)
  File "/home/hugo/openerp/sources/6.1/openobject-server/openerp/osv/orm.py", line 4295, in _store_get_values
    target_ids = [id for id in function[id_mapping_fnct_](self, cr, SUPERUSER_ID, ids, context) if id]
  File "/home/hugo/openerp/sources/6.1/modules/hr/hr.py", line 85, in _get_job_position
    if employee.job_id:
  File "/home/hugo/openerp/sources/6.1/openobject-server/openerp/osv/orm.py", line 478, in __getattr__
    raise AttributeError(e)
AttributeError: 'Field job_id not found in browse_record(hr.employee, 13)'

I think that this error is related with this commit http://bazaar.launchpad.net/~openerp/openobject-server/6.1/revision/4262 because the field job_id is a field of hr.employee that is used to decide when to store a function in hr.job object and reverting changes to revision 4261 makes that it works as expected and there no are problems when trying to unlink an Employee.

Regards.

Amit Parik (amit-parik)
affects: openobject-server → openobject-addons
Amit Parik (amit-parik)
summary: - Error on Employee unlink
+ [6.1]Error on Employee unlink
Changed in openobject-addons:
assignee: nobody → OpenERP Publisher's Warranty Team (openerp-opw)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Nehal Panchal (OpenERP) (nep-openerp) wrote :

Hello,

This issue has been fixed with following branch:
Branch: lp:~openerp-dev/openobject-addons/6.1-opw-578933-nep with
Revision-id : <email address hidden>
Revision-no : 6986

Soon our experts will review and merge it in stable(6.1) addons.

Regards,
Nehal Panchal

Changed in openobject-addons:
status: Confirmed → In Progress
status: In Progress → Fix Committed
Changed in therp-backports:
status: New → Incomplete
status: Incomplete → Fix Committed
importance: Undecided → High
assignee: nobody → Stefan Rijnhart (Therp) (stefan-therp)
milestone: none → 6.1-maintenance
Changed in therp-backports:
status: Fix Committed → Fix Released
Revision history for this message
Mohamed M. Hagag (mohamedhagag1981) wrote :

This issue is still in the latest release dated 20121205:

Client Traceback (most recent call last):
  File "/opt/openerp-6.1/openerp/addons/web/common/http.py", line 180, in dispatch
    response["result"] = method(controller, self, **self.params)
  File "/opt/openerp-6.1/openerp/addons/web/controllers/main.py", line 1044, in call
    return self.call_common(req, model, method, args, domain_id, context_id)
  File "/opt/openerp-6.1/openerp/addons/web/controllers/main.py", line 996, in call_common
    return self._call_kw(req, model, method, args, {})
  File "/opt/openerp-6.1/openerp/addons/web/controllers/main.py", line 1010, in _call_kw
    return getattr(req.session.model(model), method)(*args, **kwargs)
  File "/opt/openerp-6.1/openerp/addons/web/common/openerplib/main.py", line 250, in proxy
    args, kw)
  File "/opt/openerp-6.1/openerp/addons/web/common/openerplib/main.py", line 117, in proxy
    result = self.connector.send(self.service_name, method, *args)
  File "/opt/openerp-6.1/openerp/addons/web/common/http.py", line 608, in send
    raise xmlrpclib.Fault(openerp.tools.exception_to_unicode(e), formatted_info)

Server Traceback (most recent call last):
  File "/opt/openerp-6.1/openerp/addons/web/common/http.py", line 593, in send
    return openerp.netsvc.dispatch_rpc(service_name, method, args)
  File "/opt/openerp-6.1/openerp/netsvc.py", line 360, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/opt/openerp-6.1/openerp/service/web_services.py", line 586, in dispatch
    res = fn(db, uid, *params)
  File "/opt/openerp-6.1/openerp/osv/osv.py", line 167, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/opt/openerp-6.1/openerp/osv/osv.py", line 121, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/openerp-6.1/openerp/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/openerp-6.1/openerp/osv/osv.py", line 164, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/openerp-6.1/openerp/addons/hr/hr.py", line 189, in unlink
    return super(hr_employee, self).unlink(cr, uid, ids, context=context)
  File "/opt/openerp-6.1/openerp/osv/orm.py", line 3726, in unlink
    result_store = self._store_get_values(cr, uid, ids, self._all_columns.keys(), context)
  File "/opt/openerp-6.1/openerp/osv/orm.py", line 4295, in _store_get_values
    target_ids = [id for id in function[id_mapping_fnct_](self, cr, SUPERUSER_ID, ids, context) if id]
  File "/opt/openerp-6.1/openerp/addons/hr/hr.py", line 85, in _get_job_position
    if employee.job_id:
  File "/opt/openerp-6.1/openerp/osv/orm.py", line 478, in __getattr__
    raise AttributeError(e)
AttributeError: 'Field job_id not found in browse_record(hr.employee, 10)'

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Mohamed,

This bug is not released still on 6.1 version, Its only fix committed code not applied on stable 6.1 yet.

If you want solve this easily then you can apply the patch of lp:~openerp-dev/openobject-addons/6.1-opw-578933-nep branch and you can solve.

This will applied on 6.1 soon,,!!

Lara (Therp) (lfreeke)
Changed in therp-backports:
milestone: 6.1-maintenance → 7.0-maintenance
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.