BASE: add logger for print instance workflow
bzr revid: ced-267a6d7516e78c8e64be1a370bbf00a452e8b610
This commit is contained in:
parent
5d5069b294
commit
3c9e4b6679
|
@ -113,11 +113,11 @@ def graph_instance_get(cr, graph, inst_id, nested=False):
|
||||||
|
|
||||||
class report_graph_instance(object):
|
class report_graph_instance(object):
|
||||||
def __init__(self, cr, uid, ids, data):
|
def __init__(self, cr, uid, ids, data):
|
||||||
|
logger = netsvc.Logger()
|
||||||
try:
|
try:
|
||||||
import pydot
|
import pydot
|
||||||
except Exception,e:
|
except Exception,e:
|
||||||
print 'Import Error for pydot, you will not be able to render workflows'
|
logger.notifyChannel('workflow', netsvc.LOG_WARNING, 'Import Error for pydot, you will not be able to render workflows\nConsider Installing PyDot or dependencies: http://dkbza.org/pydot.html')
|
||||||
print 'Consider Installing PyDot or dependencies: http://dkbza.org/pydot.html'
|
|
||||||
raise e
|
raise e
|
||||||
self.done = False
|
self.done = False
|
||||||
|
|
||||||
|
@ -135,7 +135,10 @@ class report_graph_instance(object):
|
||||||
graph.set('rankdir', 'LR')
|
graph.set('rankdir', 'LR')
|
||||||
graph_instance_get(cr, graph, inst_id, data.get('nested', False))
|
graph_instance_get(cr, graph, inst_id, data.get('nested', False))
|
||||||
ps_string = graph.create_ps(prog='dot')
|
ps_string = graph.create_ps(prog='dot')
|
||||||
except:
|
except Exception, e:
|
||||||
|
import traceback, sys
|
||||||
|
tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
|
||||||
|
logger.notifyChannel('workflow', netsvc.LOG_ERROR, 'Exception in call: ' + tb_s)
|
||||||
# string is in PS, like the success message would have been
|
# string is in PS, like the success message would have been
|
||||||
ps_string = '''%PS-Adobe-3.0
|
ps_string = '''%PS-Adobe-3.0
|
||||||
/inch {72 mul} def
|
/inch {72 mul} def
|
||||||
|
|
Loading…
Reference in New Issue