From 3611f431b93e4bed0bfb8d360dc19cb2aa52778b Mon Sep 17 00:00:00 2001 From: "Kuldeep Joshi (OpenERP)" Date: Thu, 14 Jun 2012 11:34:50 +0530 Subject: [IMP]document: remove warning bzr revid: kjo@tinyerp.com-20120614060450-w8771020su128gmg --- addons/document/document_directory.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'addons/document/document_directory.py') diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index d09d2cc86d5..9cc750b7c12 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -78,9 +78,8 @@ class document_directory(osv.osv): root_id = objid.read(cr, uid, mid, ['res_id'])['res_id'] return root_id except Exception, e: - import netsvc - logger = netsvc.Logger() - logger.notifyChannel("document", netsvc.LOG_WARNING, 'Cannot set directory root:'+ str(e)) + import logging + logging.getLogger('document').warning('Cannot set directory root:'+ str(e)) return False return objid.browse(cr, uid, mid, context=context).res_id -- 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_directory.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'addons/document/document_directory.py') diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index 9cc750b7c12..d7d2e4763c7 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -22,10 +22,10 @@ from osv import osv, fields from osv.orm import except_orm - +import logging import nodes from tools.translate import _ - +_loggerdir = logging.getLogger(__name__) class document_directory(osv.osv): _name = 'document.directory' _description = 'Directory' @@ -78,8 +78,8 @@ class document_directory(osv.osv): root_id = objid.read(cr, uid, mid, ['res_id'])['res_id'] return root_id except Exception, e: - import logging - logging.getLogger('document').warning('Cannot set directory root:'+ str(e)) + + _loggerdir.warning('Cannot set directory root:'+ str(e)) return False return objid.browse(cr, uid, mid, context=context).res_id -- 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_directory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/document/document_directory.py') diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index d7d2e4763c7..03b2dcc47bf 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -25,7 +25,7 @@ from osv.orm import except_orm import logging import nodes from tools.translate import _ -_loggerdir = logging.getLogger(__name__) +_logger = logging.getLogger(__name__) class document_directory(osv.osv): _name = 'document.directory' _description = 'Directory' @@ -79,7 +79,7 @@ class document_directory(osv.osv): return root_id except Exception, e: - _loggerdir.warning('Cannot set directory root:'+ str(e)) + _logger.warning('Cannot set directory root:'+ str(e)) return False return objid.browse(cr, uid, mid, context=context).res_id -- cgit v1.2.3 From d3f30baa8169bec1db40bb2e582931b623acb142 Mon Sep 17 00:00:00 2001 From: "Saurang Suthar(OpenERP)" <> Date: Wed, 25 Jul 2012 16:03:34 +0530 Subject: [IMP] Improved warning messages for document module bzr revid: pso@tinyerp.com-20120725103334-rx24b2aojluvxuap --- addons/document/document_directory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/document/document_directory.py') diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index 03b2dcc47bf..2e68916e7ab 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -108,7 +108,7 @@ class document_directory(osv.osv): _sql_constraints = [ ('dirname_uniq', 'unique (name,parent_id,ressource_id,ressource_parent_type_id)', 'The directory name must be unique !'), ('no_selfparent', 'check(parent_id <> id)', 'Directory cannot be parent of itself!'), - ('dir_parented', 'check(parent_id IS NOT NULL OR storage_id IS NOT NULL)', 'Directory must have a parent or a storage') + ('dir_parented', 'check(parent_id IS NOT NULL OR storage_id IS NOT NULL)', 'Directory must have a parent or a storage.') ] def name_get(self, cr, uid, ids, context=None): res = [] @@ -193,7 +193,7 @@ class document_directory(osv.osv): elif dbro.type == 'ressource': return nodes.node_res_dir else: - raise ValueError("dir node for %s type", dbro.type) + raise ValueError("dir node for %s type!", dbro.type) def _prepare_context(self, cr, uid, nctx, context=None): """ Fill nctx with properties for this database -- cgit v1.2.3 From bc68e4079cd14f100330c55c074cfb93f3538cd9 Mon Sep 17 00:00:00 2001 From: "pso (OpenERP)" Date: Fri, 27 Jul 2012 12:25:57 +0530 Subject: [IMP] Improved warning messages bzr revid: pso@tinyerp.com-20120727065557-vvhog448zrrfuibd --- addons/document/document_directory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/document/document_directory.py') diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index 2e68916e7ab..4afb5a0b121 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -153,7 +153,7 @@ class document_directory(osv.osv): return True _constraints = [ - (_check_recursion, 'Error! You can not create recursive Directories.', ['parent_id']) + (_check_recursion, 'Error! You cannot create recursive Directories.', ['parent_id']) ] def __init__(self, *args, **kwargs): -- cgit v1.2.3 From a52eeef5194b5fdab2b1d659f383c7589a2ebb98 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 6 Aug 2012 19:08:41 +0200 Subject: [IMP] rephrase some error and warning messages in document, edi, google_base_account, mrp and mrp_repair remove exclamation marks at the end of messages remove unjustified capital letters bzr revid: abo@openerp.com-20120806170841-cx9vuend1vglmsqk --- addons/document/document_directory.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'addons/document/document_directory.py') diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index 4afb5a0b121..0f18673a007 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -78,7 +78,7 @@ class document_directory(osv.osv): root_id = objid.read(cr, uid, mid, ['res_id'])['res_id'] return root_id except Exception, e: - + _logger.warning('Cannot set directory root:'+ str(e)) return False return objid.browse(cr, uid, mid, context=context).res_id @@ -153,7 +153,7 @@ class document_directory(osv.osv): return True _constraints = [ - (_check_recursion, 'Error! You cannot create recursive Directories.', ['parent_id']) + (_check_recursion, 'Error! You cannot create recursive directories.', ['parent_id']) ] def __init__(self, *args, **kwargs): @@ -179,7 +179,7 @@ class document_directory(osv.osv): def get_node_class(self, cr, uid, ids, dbro=None, dynamic=False, context=None): """Retrieve the class of nodes for this directory - + This function can be overriden by inherited classes ;) @param dbro The browse object, if caller already has it """ @@ -193,17 +193,17 @@ class document_directory(osv.osv): elif dbro.type == 'ressource': return nodes.node_res_dir else: - raise ValueError("dir node for %s type!", dbro.type) + raise ValueError("dir node for %s type.", dbro.type) def _prepare_context(self, cr, uid, nctx, context=None): """ Fill nctx with properties for this database @param nctx instance of nodes.node_context, to be filled @param context ORM context (dict) for us - - Note that this function is called *without* a list of ids, + + Note that this function is called *without* a list of ids, it should behave the same for the whole database (based on the ORM instance of document.directory). - + Some databases may override this and attach properties to the node_context. See WebDAV, CalDAV. """ -- cgit v1.2.3