← Back to team overview

openerp-india team mailing list archive

[Bug 972344] Re: current user can't create a new employees if res.partner.address is missing

 

*** This bug is a duplicate of bug 753133 ***
    https://bugs.launchpad.net/bugs/753133

** This bug has been marked a duplicate of bug 753133
   Wrong default address of employee

-- 
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/972344

Title:
  current user can't create a new employees if res.partner.address is
  missing

Status in OpenERP Addons (modules):
  New

Bug description:
  Hi,

  so to recreate the bug just create a new database with demo data,
  sales, and hr employee is needed.

  This is the same for every employee that has the right to create new
  employees.

  So with the demo data lets pick 'administrator'.

  Log in with the user administrator (User ID in res_users  is 1)
  Then go to sales - address book - addresses
  search for the 'OpenERP S.A.' and delete it. (address with the ID 1 in res_partner_address)

  Now go to human resources - human resources - employees
  try to create a new employee and see the error occurs.

  ERROR MESSAGE START:
  Traceback (most recent call last): File "/server/bin/netsvc.py", line 489, in dispatch result = ExportService.getService(service_name).dispatch(method, auth, params) File "/server/bin/service/web_services.py", line 599, in dispatch res = fn(db, uid, *params) File "/server/bin/osv/osv.py", line 122, in wrapper return f(self, dbname, *args, **kwargs) File "/server/bin/osv/osv.py", line 176, in execute res = self.execute_cr(cr, uid, obj, method, *args, **kw) File "/server/bin/osv/osv.py", line 167, in execute_cr return getattr(object, method)(cr, uid, *args, **kw) File "/server/bin/osv/orm.py", line 986, in default_get defaults[f] = self._defaults[f](self, cr, uid, context) File "/server/bin/addons/hr/hr.py", line 194, in <lambda> 'address_id': lambda self,cr,uid,c: self.pool.get('res.partner.address').browse(cr, uid, uid, c).partner_id.id File "/server/bin/osv/orm.py", line 294, in __getattr__ raise AttributeError(e) AttributeError: 'Field partner_id not found in browse_record(res.partner.address, 1)' 
  ERROR MESSAGE END

  Don't know why that error occurs but you can't create any employee
  with that user anymore. I had to create a dummy in res_partner_address
  with the 'ID 1' so he could find it again and use it. Though i still
  don't get it why he needs explicit the res_partner_address with the
  'ID 1'.

  I also tested it with other users and it seems to appear if you delete
  the res_partner_address with the same ID that the user have. Let's say
  demo user has the ID 3 (in res_users) and you delete the entry in
  res_partner_address that has the ID 3 it gets the error.

  Hope that helps 
  Regards brainchild

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/972344/+subscriptions


References