c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #17273
[Bug 723713] [NEW] [6.0] Unable to create employee with a no-admin account
Public bug reported:
Hi,
I can't create an Employee in the hr module if I'm not admin. I got an
error from this line of code:
hr.py / l194
_defaults = {
...[snip]...
'address_id': lambda self,cr,uid,c: self.pool.get('res.partner.address').browse(cr, uid, uid, c).partner_id.id
}
File "/home/openerp6rc1/6.0-Stable/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
"/home/openerp6rc1/6.0-Stable/server/bin/osv/orm.py", line 294, in
__getattr__ raise AttributeError(e) AttributeError: 'Field partner_id
not found in browse_record(res.partner.address, 7)'
I'm pretty sure the bug come from the fact that you browse on 'uid' ids
on res.parter.address (instead of the users table). So it works when the
user is admin because the address with id=1 exists. But, in my case, the
address with id=7 doesn't.
** Affects: openobject-addons
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/723713
Title:
[6.0] Unable to create employee with a no-admin account
Status in OpenERP Modules (addons):
New
Bug description:
Hi,
I can't create an Employee in the hr module if I'm not admin. I got an
error from this line of code:
hr.py / l194
_defaults = {
...[snip]...
'address_id': lambda self,cr,uid,c: self.pool.get('res.partner.address').browse(cr, uid, uid, c).partner_id.id
}
File "/home/openerp6rc1/6.0-Stable/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
"/home/openerp6rc1/6.0-Stable/server/bin/osv/orm.py", line 294, in
__getattr__ raise AttributeError(e) AttributeError: 'Field partner_id
not found in browse_record(res.partner.address, 7)'
I'm pretty sure the bug come from the fact that you browse on 'uid'
ids on res.parter.address (instead of the users table). So it works
when the user is admin because the address with id=1 exists. But, in
my case, the address with id=7 doesn't.
Follow ups
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: qdp (OpenERP), 2011-03-10
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: Mustufa Rangwala (Open ERP), 2011-02-28
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: Ashvin Rathod (OpenERP), 2011-02-28
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: Launchpad Bug Tracker, 2011-02-28
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: Ashvin Rathod (OpenERP), 2011-02-28
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: Atik Agewan(OpenERP), 2011-02-28
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: Atik Agewan(OpenERP), 2011-02-25
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: Amit Parik (OpenERP), 2011-02-24
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: Amit Parik (OpenERP), 2011-02-24
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: Thibaut DIRLIK, 2011-02-24
-
[Bug 723713] Re: [6.0] Unable to create employee with a no-admin account
From: Amit Parik (OpenERP), 2011-02-24
-
[Bug 723713] [NEW] [6.0] Unable to create employee with a no-admin account
From: Thibaut DIRLIK, 2011-02-23
References