summaryrefslogtreecommitdiff
path: root/addons/import_base/import_framework.py
diff options
context:
space:
mode:
authorVijaykumar Baladaniya <vba@tinyerp.com>2012-07-09 18:31:13 +0530
committerVijaykumar Baladaniya <vba@tinyerp.com>2012-07-09 18:31:13 +0530
commitbe2e95656aaa113addea2b510fcdcf2f890eaaa4 (patch)
treeabcb3dd4ef350a1b8ad0eaffdd2b9a1cb91521af /addons/import_base/import_framework.py
parentb982ea278b33132def3927417b7a854b98b5028a (diff)
parent3925f76ce85854e5d4834902a05f57bcfc5ace85 (diff)
[MERGE]merged with trunk-survey-layout-tta
bzr revid: vba@tinyerp.com-20120709130113-3lchipgil9oqpglg
Diffstat (limited to 'addons/import_base/import_framework.py')
-rw-r--r--addons/import_base/import_framework.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/addons/import_base/import_framework.py b/addons/import_base/import_framework.py
index 44243aa952c..8bcda79c64e 100644
--- a/addons/import_base/import_framework.py
+++ b/addons/import_base/import_framework.py
@@ -30,7 +30,7 @@ import logging
import StringIO
import traceback
pp = pprint.PrettyPrinter(indent=4)
-
+_logger = logging.getLogger(__name__)
@@ -60,7 +60,6 @@ class import_framework(Thread):
self.context = context or {}
self.email = email_to_notify
self.table_list = []
- self.logger = logging.getLogger(module_name)
self.initialize()
"""
@@ -165,7 +164,7 @@ class import_framework(Thread):
data_i is a map external field_name => value
and each data_i have a external id => in data_id['id']
"""
- self.logger.info(' Importing %s into %s' % (table, model))
+ _logger.info(' Importing %s into %s' % (table, model))
if not datas:
return (0, 'No data found')
mapping['id'] = 'id_new'
@@ -188,7 +187,7 @@ class import_framework(Thread):
model_obj = self.obj.pool.get(model)
if not model_obj:
raise ValueError(_("%s is not a valid model name") % model)
- self.logger.debug(_(" fields imported : ") + str(fields))
+ _logger.debug(_(" fields imported : ") + str(fields))
(p, r, warning, s) = model_obj.import_data(self.cr, self.uid, fields, res, mode='update', current_module=self.module_name, noupdate=True, context=self.context)
for (field, field_name) in self_dependencies:
self._import_self_dependencies(model_obj, field, datas)
@@ -431,9 +430,9 @@ class import_framework(Thread):
'auto_delete' : True})
email_obj.send(self.cr, self.uid, [email_id])
if error:
- self.logger.error(_("Import failed due to an unexpected error"))
+ _logger.error(_("Import failed due to an unexpected error"))
else:
- self.logger.info(_("Import finished, notification email sended"))
+ _logger.info(_("Import finished, notification email sended"))
def get_email_subject(self, result, error=False):
"""