[FIX] related are stored

bzr revid: fp@tinyerp.com-20091209095219-kzj9g3eetf5js2tf
This commit is contained in:
Fabien Pinckaers 2009-12-09 10:52:19 +01:00
parent 920c9dd540
commit 3b12be5d20
2 changed files with 5 additions and 0 deletions

View File

@ -785,6 +785,9 @@ class related(function):
self.arg = arg
self._relations = []
super(related, self).__init__(self._fnct_read, arg, self._fnct_write, fnct_inv_arg=arg, method=True, fnct_search=self._fnct_search, **args)
if self.store is True:
# TODO: improve here to change self.store = {...} according to related objects
pass
def _field_get2(self, cr, uid, obj, context={}):
if self._relations:

View File

@ -3165,7 +3165,9 @@ class orm(orm_template):
','.join(tables) +qu1 + limit_str + offset_str, qu2)
res = cr.fetchall()
return res[0][0]
# execute the "main" query to fetch the ids we were searching for
print 'select %s.id from ' % self._table + ','.join(tables) +qu1+' order by '+order_by+limit_str+offset_str, qu2
cr.execute('select %s.id from ' % self._table + ','.join(tables) +qu1+' order by '+order_by+limit_str+offset_str, qu2)
res = cr.fetchall()
return [x[0] for x in res]