Document: storage must be set before _set_data

No attempt to use a default one.

Conflicts:

	document/nodes.py

bzr revid: p_christ@hol.gr-20100701175133-783ril5hg7rls246
This commit is contained in:
P. Christeas 2010-07-01 20:51:33 +03:00
parent 575889d33e
commit 1819f137e9
1 changed files with 1 additions and 6 deletions

View File

@ -934,12 +934,7 @@ class node_file(node_class):
the browse object. """
# this is where storage kicks in..
stor = self.storage_id
if not stor:
data_obj = self.context._dirobj.pool.get('ir.model.data')
data_id = data_obj._get_id(cr, self.context.uid, 'document', 'storage_db')
if data_id:
stor = data_obj.browse(cr, self.context.uid, data_id, context=self.context.context).res_id
assert stor
assert stor, "No storage for file #%s" % self.file_id
stobj = self.context._dirobj.pool.get('document.storage')
return stobj.set_data(cr, self.context.uid,stor, self, data, self.context.context, fil_obj)