context['object'] = obj
for i in expr:
context['active_id'] = i.id
- result = self.run(cr, uid, [action.loop_action.id], context)
+ self.run(cr, uid, [action.loop_action.id], context)
if action.state == 'object_write':
res = {}
expr = exp.value
res[exp.col1.name] = expr
- obj_pool = None
- res_id = False
obj_pool = self.pool.get(action.srcmodel_id.model)
res_id = obj_pool.create(cr, uid, res)
if action.record_id:
model = action.copy_object.split(',')[0]
cid = action.copy_object.split(',')[1]
obj_pool = self.pool.get(model)
- res_id = obj_pool.copy(cr, uid, int(cid), res)
+ obj_pool.copy(cr, uid, int(cid), res)
return False
_logger.warning('Tried to poll an undefined table on database %s.', db_name)
else:
raise
- except Exception, ex:
+ except Exception:
_logger.warning('Exception in cron:', exc_info=True)
finally:
ids.reverse()
for data in self.browse(cr, uid, ids, context):
model = data.model
- model_obj = self.pool.get(model)
name = openerp.tools.ustr(data.name)
# double-check we are really going to delete all the owners of this schema element
if model == 'ir.model.fields')
ir_model_relation = self.pool.get('ir.model.relation')
- relation_ids = ir_model_relation.search(cr, uid, [('module', 'in', modules_to_remove)])
ir_module_module = self.pool.get('ir.module.module')
modules_to_remove_ids = ir_module_module.search(cr, uid, [('name', 'in', modules_to_remove)])
relation_ids = ir_model_relation.search(cr, uid, [('module', 'in', modules_to_remove_ids)])
values = self._add_missing_default_values(cr, uid, values, context)
values['id'] = super(ir_sequence, self).create(cr, uid, values, context)
if values['implementation'] == 'standard':
- f = self._create_sequence(cr, values['id'], values['number_increment'], values['number_next'])
+ self._create_sequence(cr, values['id'], values['number_increment'], values['number_next'])
return values['id']
def unlink(self, cr, uid, ids, context=None):
continue
# keep only the first action registered for each action name
results[action['name']] = (action['id'], action['name'], action_def)
- except except_orm, e:
+ except except_orm:
continue
return sorted(results.values())
activity_from = actfrom[t['act_from']][1].get(t['signal'], actfrom[t['act_from']][0])
activity_to = actto[t['act_to']][1].get(t['signal'], actto[t['act_to']][0])
graph.add_edge(pydot.Edge( str(activity_from) ,str(activity_to), fontsize='10', **args))
- nodes = cr.dictfetchall()
+
cr.execute('select * from wkf_activity where flow_start=True and wkf_id in ('+','.join(['%s']*len(wkf_ids))+')', wkf_ids)
start = cr.fetchone()[0]
cr.execute("select 'subflow.'||name,id from wkf_activity where flow_stop=True and wkf_id in ("+','.join(['%s']*len(wkf_ids))+')', wkf_ids)
def graph_instance_get(cr, graph, inst_id, nested=False):
- workitems = {}
cr.execute('select wkf_id from wkf_instance where id=%s', (inst_id,))
inst = cr.fetchall()
inst_id = inst_id[0]
graph_instance_get(cr, graph, inst_id, data.get('nested', False))
ps_string = graph.create(prog='dot', format='ps')
- except Exception, e:
+ except Exception:
_logger.exception('Exception in call:')
# string is in PS, like the success message would have been
ps_string = '''%PS-Adobe-3.0