[FIX] orm: try..except block is buggy. dom is used in this block

bzr revid: hmo@tinyerp.com-20091123064628-ovsu709rr8eh1xff
This commit is contained in:
Harry (Open ERP)
2009-11-23 12:16:28 +05:30
parent dad1ff955b
commit 055ed99069
+2 -9
View File
@@ -1373,15 +1373,8 @@ class orm_template(object):
result['name'] = 'default'
result['field_parent'] = False
result['view_id'] = 0
try:
doc = dom.minidom.parseString(encode(result['arch']))
except Exception, ex:
logger = netsvc.Logger()
logger.notifyChannel('init', netsvc.LOG_DEBUG, 'Wrong arch in %s (%s):\n %s' % (result['name'], view_type, result['arch'] ))
raise except_orm('Error',
('Invalid xml in view %s(%d) of %s: %s' % (result['name'], result['view_id'], self._name, str(ex))))
xarch, xfields = self.__view_look_dom_arch(cr, user, doc, view_id, context=context)
xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=context)
result['arch'] = xarch
result['fields'] = xfields