[FIX] don't just print a warning if an @eval fails in an XML file
bzr revid: xmo@openerp.com-20120126133013-5fnsouix8cutwlik
This commit is contained in:
parent
3049760fe6
commit
5c40627e4b
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue