[FIX] don't just print a warning if an @eval fails in an XML file
authorXavier Morel <xmo@openerp.com>
Thu, 26 Jan 2012 13:30:13 +0000 (14:30 +0100)
committerXavier Morel <xmo@openerp.com>
Thu, 26 Jan 2012 13:30:13 +0000 (14:30 +0100)
bzr revid: xmo@openerp.com-20120126133013-5fnsouix8cutwlik

openerp/tools/convert.py

index 553aa48..ec3e676 100644 (file)
@@ -129,15 +129,14 @@ def _eval_xml(self, node, pool, cr, uid, idref, context=None):
                     f_val = f_val[0]
             return f_val
         a_eval = node.get('eval','')
-        idref2 = {}
         if a_eval:
             idref2 = _get_idref(self, cr, uid, f_model, context, idref)
             try:
                 return unsafe_eval(a_eval, idref2)
             except Exception:
-                logger = logging.getLogger('init')
-                logger.warning('could not eval(%s) for %s in %s' % (a_eval, node.get('name'), context), exc_info=True)
-                return ""
+                logging.getLogger('openerp.tools.convert.init').error(
+                    'Could not eval(%s) for %s in %s', a_eval, node.get('name'), context)
+                raise
         if t == 'xml':
             def _process(s, idref):
                 m = re.findall('[^%]%\((.*?)\)[ds]', s)