diff options
| author | Harry (OpenERP) <hmo@tinyerp.com> | 2010-10-15 18:44:59 +0530 |
|---|---|---|
| committer | Harry (OpenERP) <hmo@tinyerp.com> | 2010-10-15 18:44:59 +0530 |
| commit | 824042bb1cd0ce992e7ab4789497487b95b12fb8 (patch) | |
| tree | 1600ed5e35d7de81b4b2795e33a591466a0b3474 /addons/document/document.py | |
| parent | c7c8bdf909fe91c1522598969b819542e0469f04 (diff) | |
| parent | ecbd4323e8e8b34bbdd73f0524478914e76dd6ba (diff) | |
[MERGE]
bzr revid: hmo@tinyerp.com-20101015131459-k969h71ybafv5kib
Diffstat (limited to 'addons/document/document.py')
| -rw-r--r-- | addons/document/document.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/document/document.py b/addons/document/document.py index 92a00f3222c..470d67c582b 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -28,6 +28,7 @@ import os import tools from tools.translate import _ import nodes +import logging DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config['root_path'], 'filestore')) @@ -106,7 +107,7 @@ class document_file(osv.osv): 'parent_id': __get_def_directory } _sql_constraints = [ - ('filename_uniq', 'unique (name,parent_id,res_id,res_model)', 'The file name must be unique !') + # filename_uniq is not possible in pure SQL ] def _check_duplication(self, cr, uid, vals, ids=[], op='create'): name = vals.get('name', False) @@ -259,6 +260,9 @@ class document_file(osv.osv): r = stor.prepare_unlink(cr, uid, storage_id, f) if r: unres.append(r) + else: + logging.getLogger('document').warning("Unlinking attachment #%s %s that has no storage", + f.id, f.name) res = super(document_file, self).unlink(cr, uid, ids, context) stor.do_unlink(cr, uid, unres) return res |
