summaryrefslogtreecommitdiff
path: root/bin/wizard/__init__.py
diff options
context:
space:
mode:
authorHDA (OpenERP) <hda@tinyerp.com>2009-09-17 12:57:12 +0530
committerHDA (OpenERP) <hda@tinyerp.com>2009-09-17 12:57:12 +0530
commitc68600cc5397700df4f40095c27723a2b1f90a22 (patch)
tree12980ee84da6ac5f6157929df2d0f4b7be67ab56 /bin/wizard/__init__.py
parent90e6a956ec03f49ce3f1faecf67872787e35724b (diff)
[Merged]
bzr revid: hda@tinyerp.com-20090917072712-l7220bbv1gq4uckc
Diffstat (limited to 'bin/wizard/__init__.py')
-rw-r--r--bin/wizard/__init__.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/bin/wizard/__init__.py b/bin/wizard/__init__.py
index 1621559c628..34906ec9cd6 100644
--- a/bin/wizard/__init__.py
+++ b/bin/wizard/__init__.py
@@ -24,7 +24,7 @@ import netsvc
from tools import copy
from tools.misc import UpdateableStr, UpdateableDict
from tools.translate import translate
-from xml import dom
+from lxml import etree
import ir
import pooler
@@ -50,12 +50,11 @@ class interface(netsvc.Service):
self.wiz_name = name
def translate_view(self, cr, node, state, lang):
- if node.nodeType == node.ELEMENT_NODE:
- if node.hasAttribute('string') and node.getAttribute('string'):
- trans = translate(cr, self.wiz_name+','+state, 'wizard_view', lang, node.getAttribute('string').encode('utf8'))
- if trans:
- node.setAttribute('string', trans)
- for n in node.childNodes:
+ if node.get('string'):
+ trans = translate(cr, self.wiz_name+','+state, 'wizard_view', lang, node.get('string').encode('utf8'))
+ if trans:
+ node.set('string', trans)
+ for n in node.getchildren():
self.translate_view(cr, n, state, lang)
def execute_cr(self, cr, uid, data, state='init', context=None):
@@ -132,9 +131,9 @@ class interface(netsvc.Service):
# translate arch
if not isinstance(arch, UpdateableStr):
- doc = dom.minidom.parseString(arch.encode('utf8'))
+ doc = etree.XML(arch)
self.translate_view(cr, doc, state, lang)
- arch = doc.toxml()
+ arch = etree.tostring(doc)
# translate buttons
button_list = list(button_list)