From 0adc5881463d83f956faabec28db9a911bb20fca Mon Sep 17 00:00:00 2001 From: greg-apieum <> Date: Wed, 24 Feb 2010 10:32:10 +0100 Subject: [PATCH] ADD to config 'document_path' to set ftp root path bzr revid: greg-apieum-20100224093210-mpitlp5ckckxjvm5 --- addons/document/document.py | 3 ++- addons/document/document_storage.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 6544e94d08d..ed2d823602a 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -36,12 +36,13 @@ import tools from tools.translate import _ import nodes +DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config['root_path'], 'filestore')) class document_file(osv.osv): _inherit = 'ir.attachment' _rec_name = 'datas_fname' def _get_filestore(self, cr): - return os.path.join(tools.config['root_path'], 'filestore', cr.dbname) + return os.path.join(DMS_ROOT_PATH, cr.dbname) def _data_get(self, cr, uid, ids, name, arg, context): fbrl = self.browse(cr, uid, ids, context=context) diff --git a/addons/document/document_storage.py b/addons/document/document_storage.py index 615bfaca1f3..1cf643d0eb5 100644 --- a/addons/document/document_storage.py +++ b/addons/document/document_storage.py @@ -34,6 +34,8 @@ import string import netsvc from content_index import cntIndex +DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config.get('root_path'), 'filestore')) + """ The algorithm of data storage @@ -111,8 +113,7 @@ class document_storage(osv.osv): } def _get_rootpath(self, cr, uid, context=None): - from tools import config - return os.path.join(tools.config['root_path'], 'filestore', cr.dbname) + return os.path.join(DMS_ROOT_PATH, cr.dbname) _defaults = { 'user_id': lambda self, cr, uid, ctx: uid,