From ceb22841d6b79db8be8d29597f2d624de5759abf Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Mon, 18 Jun 2012 11:48:04 +0530 Subject: [IMP] add default data in document_data.xml bzr revid: fka@tinyerp.com-20120618061804-9i8ypqq2m8g7eab6 --- addons/document/document.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index 92ece063a47..6cd47569f0f 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -140,8 +140,7 @@ class document_file(osv.osv): _defaults = { 'user_id': lambda self, cr, uid, ctx:uid, - 'file_size': lambda self, cr, uid, ctx:0, - 'parent_id': __get_def_directory + 'file_size': lambda self, cr, uid, ctx:0 } _sql_constraints = [ # filename_uniq is not possible in pure SQL -- cgit v1.2.3 From 0c374a66bc3de5cdf48eb66b2078c0946aa045db Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 22 Jun 2012 12:18:39 +0530 Subject: [IMP] Add logging at the top of python files bzr revid: fka@tinyerp.com-20120622064839-llitm8szgikxznwr --- addons/document/document.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index 6cd47569f0f..1f584e08d83 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -30,11 +30,14 @@ from tools.translate import _ import nodes import logging +_loggerdoc = logging.getLogger(__name__) + 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 _attach_parent_id(self, cr, uid, ids=None, context=None): """Migrate ir.attachments to the document module. @@ -54,7 +57,7 @@ class document_file(osv.osv): parent_id = self.pool.get('document.directory')._get_root_directory(cr,uid) if not parent_id: - logging.getLogger('document').warning("at _attach_parent_id(), still not able to set the parent!") + _loggerdoc.warning("at _attach_parent_id(), still not able to set the parent!") return False if ids is not None: @@ -335,7 +338,7 @@ class document_file(osv.osv): if r: unres.append(r) else: - logging.getLogger('document').warning("Unlinking attachment #%s %s that has no storage", + self.loggerdoc.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) -- cgit v1.2.3 From 87decf703a549d4f81d5742898066277d584c787 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 22 Jun 2012 12:55:45 +0530 Subject: [IMP] Add logging at the top of python files bzr revid: fka@tinyerp.com-20120622072545-uuok6zj2jm2koxw4 --- addons/document/document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index 1f584e08d83..c213ca57549 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -38,7 +38,7 @@ class document_file(osv.osv): _inherit = 'ir.attachment' _rec_name = 'datas_fname' - + def _attach_parent_id(self, cr, uid, ids=None, context=None): """Migrate ir.attachments to the document module. -- cgit v1.2.3 From 06391b79366765df2845c5e1f67adf566b50349a Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Mon, 25 Jun 2012 14:36:19 +0530 Subject: [IMP] add logger instead of_loggerdoc or _log., Add .warning() instead of .debug() in account bzr revid: fka@tinyerp.com-20120625090619-r25n9pqs89oh5180 --- addons/document/document.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index c213ca57549..b304f54cec3 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -30,7 +30,7 @@ from tools.translate import _ import nodes import logging -_loggerdoc = logging.getLogger(__name__) +_logger = logging.getLogger(__name__) DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config['root_path'], 'filestore')) @@ -57,7 +57,7 @@ class document_file(osv.osv): parent_id = self.pool.get('document.directory')._get_root_directory(cr,uid) if not parent_id: - _loggerdoc.warning("at _attach_parent_id(), still not able to set the parent!") + _logger.warning("at _attach_parent_id(), still not able to set the parent!") return False if ids is not None: -- cgit v1.2.3 From c180a7f941b503b9a06a8dad8a6c117374775b25 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Tue, 26 Jun 2012 22:19:46 +0200 Subject: [FIX] revert ir_values on document bzr revid: al@openerp.com-20120626201946-44c5odspvbttqyv1 --- addons/document/document.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index b304f54cec3..66b47fd7fea 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -143,7 +143,8 @@ class document_file(osv.osv): _defaults = { 'user_id': lambda self, cr, uid, ctx:uid, - 'file_size': lambda self, cr, uid, ctx:0 + 'parent_id': __get_def_directory + 'file_size': lambda self, cr, uid, ctx:0 } _sql_constraints = [ # filename_uniq is not possible in pure SQL -- cgit v1.2.3 From 2e7c2174978e0ef73034453efce5a9a404d0a504 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Tue, 26 Jun 2012 22:42:50 +0200 Subject: [FIX] typo bzr revid: al@openerp.com-20120626204250-ez6v0cyrjg30h521 --- addons/document/document.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index 66b47fd7fea..fa65f8d9966 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -143,8 +143,8 @@ class document_file(osv.osv): _defaults = { 'user_id': lambda self, cr, uid, ctx:uid, - 'parent_id': __get_def_directory - 'file_size': lambda self, cr, uid, ctx:0 + 'parent_id': __get_def_directory, + 'file_size': lambda self, cr, uid, ctx:0, } _sql_constraints = [ # filename_uniq is not possible in pure SQL -- cgit v1.2.3