Document: fix the storage_id of node_file.
Not all directories have a storage_id. Instead, we have to traverse the hierarchy up until we find one that has storage. bzr revid: p_christ@hol.gr-20100629135841-5myx5hyuijwv95si
This commit is contained in:
parent
4fd7b06c30
commit
bba02abfdd
|
@ -684,10 +684,14 @@ class node_file(node_class):
|
|||
|
||||
# This only propagates the problem to get_data. Better
|
||||
# fix those files to point to the root dir.
|
||||
if fil.parent_id:
|
||||
self.storage_id = fil.parent_id.storage_id.id
|
||||
else:
|
||||
self.storage_id = None
|
||||
self.storage_id = None
|
||||
par = fil.parent_id
|
||||
while par:
|
||||
if par.storage_id and par.storage_id.id:
|
||||
self.storage_id = par.storage_id.id
|
||||
break
|
||||
par = par.parent_id
|
||||
|
||||
|
||||
def open(self, cr, mode=False):
|
||||
uid = self.context.uid
|
||||
|
|
Loading…
Reference in New Issue