summaryrefslogtreecommitdiff
path: root/bin/tools/convert.py
diff options
context:
space:
mode:
authorNCH <>2009-09-25 18:10:45 +0530
committerHDA (OpenERP) <hda@tinyerp.com>2009-09-25 18:10:45 +0530
commit5611bd43322917fefea6f29850fb47fecefcb4f0 (patch)
treefd68aa97fcafaa868940e638e21c6bfc20e62ead /bin/tools/convert.py
parent7283cee5f510dc56ea0a291773c78dcd0762aac4 (diff)
[FIX] Prevent etree deprication warnings
bzr revid: hda@tinyerp.com-20090925124045-5nwmi6v6ubtpywlz
Diffstat (limited to 'bin/tools/convert.py')
-rw-r--r--bin/tools/convert.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/bin/tools/convert.py b/bin/tools/convert.py
index d6e71a3b32b..25259aa300d 100644
--- a/bin/tools/convert.py
+++ b/bin/tools/convert.py
@@ -204,12 +204,12 @@ class xml_import(object):
if not val:
return default
return val.lower() not in ('0', 'false', 'off')
-
+
def isnoupdate(self, data_node=None):
- return self.noupdate or (data_node and self.nodeattr2bool(data_node, 'noupdate', False))
+ return self.noupdate or (len(data_node) and self.nodeattr2bool(data_node, 'noupdate', False))
def get_context(self, data_node, node, eval_dict):
- data_node_context = (data_node and data_node.get('context','').encode('utf8'))
+ data_node_context = (len(data_node) and data_node.get('context','').encode('utf8'))
if data_node_context:
context = eval(data_node_context, eval_dict)
else:
@@ -222,7 +222,7 @@ class xml_import(object):
return context
def get_uid(self, cr, uid, data_node, node):
- node_uid = node.get('uid','') or (data_node and data_node.get('uid',''))
+ node_uid = node.get('uid','') or (len(data_node) and data_node.get('uid',''))
if len(node_uid):
return self.id_get(cr, None, node_uid)
return uid
@@ -293,8 +293,8 @@ form: module.record_id""" % (xml_id,)
id = self.pool.get('ir.model.data')._update(cr, self.uid, "ir.actions.report.xml", self.module, res, xml_id, noupdate=self.isnoupdate(data_node), mode=self.mode)
self.idref[xml_id] = int(id)
-
-
+
+
if not rec.get('menu') or eval(rec.get('menu','')):
keyword = str(rec.get('keyword','') or 'client_print_multi')
keys = [('action',keyword),('res_model',res['model'])]
@@ -686,7 +686,7 @@ form: module.record_id""" % (xml_id,)
# we don't want to create it, so we skip it
return None
# else, we let the record to be created
-
+
else:
# otherwise it is skipped
return None
@@ -829,7 +829,7 @@ def convert_csv_import(cr, module, fname, csvcontent, idref=None, mode='init',
if not (mode == 'init' or 'id' in fields):
logger = netsvc.Logger()
logger.notifyChannel("init", netsvc.LOG_ERROR,
- "Import specification does not contain 'id' and we are in init mode, Cannot continue.")
+ "Import specification does not contain 'id' and we are in init mode, Cannot continue.")
return
uid = 1