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 From a710d7b11c5b01b53e10555f00b32b75b7c8cade Mon Sep 17 00:00:00 2001 From: Hardik Date: Thu, 12 Jul 2012 15:47:47 +0530 Subject: [IMP]Document : Warning Messages are changed bzr revid: hsa@tinyerp.com-20120712101747-h5uhion81908cczy --- 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 fa65f8d9966..5126fde2808 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -61,7 +61,7 @@ class document_file(osv.osv): return False if ids is not None: - raise NotImplementedError("Ids is just there by convention! Don't use it yet, please.") + raise NotImplementedError("Ids is just there by convention,please donot use it yet.") cr.execute("UPDATE ir_attachment " \ "SET parent_id = %s, db_datas = decode(encode(db_datas,'escape'), 'base64') " \ -- 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.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 5126fde2808..a8994992717 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -339,7 +339,7 @@ class document_file(osv.osv): if r: unres.append(r) else: - self.loggerdoc.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 41d1135812915fd1ca4f97becceca730e284392b Mon Sep 17 00:00:00 2001 From: help <> Date: Tue, 31 Jul 2012 19:04:25 +0530 Subject: [IMP]improved exception warnings in remaining modules as per suggestion bzr revid: help-20120731133425-2zlm5sakpowuc6rk --- 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 a8994992717..27abb92c80c 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -61,7 +61,7 @@ class document_file(osv.osv): return False if ids is not None: - raise NotImplementedError("Ids is just there by convention,please donot use it yet.") + raise NotImplementedError("Ids is just there by convention,please do not use it.") cr.execute("UPDATE ir_attachment " \ "SET parent_id = %s, db_datas = decode(encode(db_datas,'escape'), 'base64') " \ -- 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.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index 27abb92c80c..3ee52f8e4fb 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -23,7 +23,7 @@ import base64 from osv import osv, fields import os -# from psycopg2 import Binary +#from psycopg2 import Binary #from tools import config import tools from tools.translate import _ @@ -37,8 +37,8 @@ DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config['roo 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. @@ -61,7 +61,7 @@ class document_file(osv.osv): return False if ids is not None: - raise NotImplementedError("Ids is just there by convention,please do not use it.") + raise NotImplementedError("Ids are just there by convention, please do not use it.") cr.execute("UPDATE ir_attachment " \ "SET parent_id = %s, db_datas = decode(encode(db_datas,'escape'), 'base64') " \ @@ -294,7 +294,7 @@ class document_file(osv.osv): ('datas_fname', '=', vals['datas_fname']), ] attach_ids = self.search(cr, uid, domain, context=context) - super(document_file, self).write(cr, uid, attach_ids, + super(document_file, self).write(cr, uid, attach_ids, {'datas' : vals['datas']}, context=context) result = attach_ids[0] -- cgit v1.2.3