[MERGE] bzr merge -r 1847..1848 lp:openobject-server ([FIX] Prevent etree deprication warnings)

lp bug: https://launchpad.net/bugs/429519 fixed

bzr revid: rvalyi@gmail.com-20091028200703-u7298esyxktryqyk
This commit is contained in:
Raphaël Valyi 2009-10-28 18:07:03 -02:00
parent c9d35c7012
commit ece8b2918a
1 changed files with 7 additions and 7 deletions

View File

@ -207,10 +207,10 @@ class xml_import(object):
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:
@ -223,7 +223,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