openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #04489
[Bug 912203] [NEW] [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
Public bug reported:
Hello,
It concerns the sparse field recently introduced in the trunk version.
I made a merge proposal here : https://code.launchpad.net/~c2c/openobject-server/trunk-server-sparse-fix-gbr/+merge/87595
An error may occur when multi sparse field are stored in a serialized field and at least one is a m2o, m2m or o2m.
The current code call self.relation, but as we loop on field_names, it should be obj._columns[field_name].relation
Traceback (most recent call last):
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/osv.py", line 120, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/osv.py", line 172, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/osv.py", line 163, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/orm.py", line 3372, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/orm.py", line 3451, in _read_flat
res2 = self.pool.get(table).read(cr, user, [x[col] for x in res], cols, context, load)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/orm.py", line 3372, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/orm.py", line 3483, in _read_flat
res2 = self._columns[val[0]].get(cr, self, ids, val, user, context=context, values=res)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/fields.py", line 1048, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/fields.py", line 1280, in _fnct_read
relation_obj = obj.pool.get(self.relation)
AttributeError: 'sparse' object has no attribute 'relation'
** Affects: openobject-server
Importance: Undecided
Status: New
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Server.
https://bugs.launchpad.net/bugs/912203
Title:
[trunk] Sparse field : AttributeError: 'sparse' object has no
attribute 'relation'
Status in OpenERP Server:
New
Bug description:
Hello,
It concerns the sparse field recently introduced in the trunk version.
I made a merge proposal here : https://code.launchpad.net/~c2c/openobject-server/trunk-server-sparse-fix-gbr/+merge/87595
An error may occur when multi sparse field are stored in a serialized field and at least one is a m2o, m2m or o2m.
The current code call self.relation, but as we loop on field_names, it should be obj._columns[field_name].relation
Traceback (most recent call last):
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/osv.py", line 120, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/osv.py", line 172, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/osv.py", line 163, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/orm.py", line 3372, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/orm.py", line 3451, in _read_flat
res2 = self.pool.get(table).read(cr, user, [x[col] for x in res], cols, context, load)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/orm.py", line 3372, in read
result = self._read_flat(cr, user, select, fields, context, load)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/orm.py", line 3483, in _read_flat
res2 = self._columns[val[0]].get(cr, self, ids, val, user, context=context, values=res)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/fields.py", line 1048, in get
result = self._fnct(obj, cr, uid, ids, name, self._arg, context)
File "/home/gbaconnier/code/camptocamp/alpha/src/server/openerp/osv/fields.py", line 1280, in _fnct_read
relation_obj = obj.pool.get(self.relation)
AttributeError: 'sparse' object has no attribute 'relation'
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-server/+bug/912203/+subscriptions
Follow ups
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Olivier Dony (OpenERP), 2012-02-14
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Launchpad Bug Tracker, 2012-02-14
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Joël Grand-Guillaume, 2012-02-10
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Guewen Baconnier @ Camptocamp, 2012-02-09
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Sébastien BEAU - http : //www . akretion . com, 2012-02-06
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Kyle Waid - http://www.gcotech.com, 2012-01-23
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Guewen Baconnier @ Camptocamp, 2012-01-20
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Jignesh Rathod(OpenERP), 2012-01-13
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Guewen Baconnier @ Camptocamp, 2012-01-11
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Jignesh Rathod(OpenERP), 2012-01-11
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Guewen Baconnier @ Camptocamp, 2012-01-09
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Kyle Waid - http://www.gcotech.com, 2012-01-08
-
[Bug 912203] Re: [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Kyle Waid - http://www.gcotech.com, 2012-01-08
-
[Bug 912203] [NEW] [trunk] Sparse field : AttributeError: 'sparse' object has no attribute 'relation'
From: Guewen Baconnier @ Camptocamp, 2012-01-05
References