[MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from bzr to git was not correctly done. The git history contains irrelevant blobs and commits. This branch brings a lot of changes and fixes, too many to list exhaustively. - New orm api, objects are now used instead of ids - Environements to encapsulates cr uid context while maintaining backward compatibility - Field compute attribute is a new object oriented way to define function fields - Shared browse record cache - New onchange protocol - Optional copy flag on fields - Documentation update - Dead code cleanup - Lots of fixes
This commit is contained in:
committed by
Antony Lesuisse
parent
d78192c489
commit
cbe2dbb672
@@ -562,6 +562,7 @@ class document_storage(osv.osv):
|
||||
# to write the fname and size, and update them in the db concurrently.
|
||||
# We cannot use a write() here, because we are already in one.
|
||||
cr.execute('UPDATE ir_attachment SET file_size = %s, index_content = %s, file_type = %s WHERE id = %s', (filesize, icont_u, mime, file_node.file_id))
|
||||
self.pool.get('ir.attachment').invalidate_cache(cr, uid, ['file_size', 'index_content', 'file_type'], [file_node.file_id], context=context)
|
||||
file_node.content_length = filesize
|
||||
file_node.content_type = mime
|
||||
return True
|
||||
@@ -1114,7 +1115,7 @@ class node_dir(node_database):
|
||||
if not self.check_perms('u'):
|
||||
raise IOError(errno.EPERM,"Permission denied.")
|
||||
|
||||
if directory._table_name=='document.directory':
|
||||
if directory._name == 'document.directory':
|
||||
if self.children(cr):
|
||||
raise OSError(39, 'Directory not empty.')
|
||||
res = self.context._dirobj.unlink(cr, uid, [directory.id])
|
||||
@@ -1694,7 +1695,7 @@ class node_file(node_class):
|
||||
return False
|
||||
document = document_obj.browse(cr, uid, self.file_id, context=self.context.context)
|
||||
res = False
|
||||
if document and document._table_name == 'ir.attachment':
|
||||
if document and document._name == 'ir.attachment':
|
||||
res = document_obj.unlink(cr, uid, [document.id])
|
||||
return res
|
||||
|
||||
|
||||
Reference in New Issue
Block a user