diff options
| author | Raphael Collet <rco@openerp.com> | 2014-07-06 16:44:26 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2014-07-06 17:05:41 +0200 |
| commit | cbe2dbb672a6c55d86f2e515f9d1cdfee426ef80 (patch) | |
| tree | d6ff62b719fce32392397783c961b734b1e4c50e /addons/document/document.py | |
| parent | d78192c489d3be66cd6487b39f5ce7ba4733a187 (diff) | |
[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
Diffstat (limited to 'addons/document/document.py')
| -rw-r--r-- | addons/document/document.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/document/document.py b/addons/document/document.py index d611539a00a..96868d3d66b 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -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 |
