[REM] unused local variables
authorXavier Morel <xmo@openerp.com>
Fri, 14 Dec 2012 13:25:33 +0000 (14:25 +0100)
committerXavier Morel <xmo@openerp.com>
Fri, 14 Dec 2012 13:25:33 +0000 (14:25 +0100)
bzr revid: xmo@openerp.com-20121214132533-aafgbov19ckb9ksp

openerp/addons/base/ir/ir_actions.py
openerp/addons/base/ir/ir_cron.py
openerp/addons/base/ir/ir_model.py
openerp/addons/base/ir/ir_sequence.py
openerp/addons/base/ir/ir_values.py
openerp/addons/base/ir/workflow/print_instance.py

index 6339774..66d6760 100644 (file)
@@ -671,7 +671,7 @@ class actions_server(osv.osv):
                 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 = {}
@@ -716,8 +716,6 @@ class actions_server(osv.osv):
                         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:
@@ -736,7 +734,7 @@ class actions_server(osv.osv):
                 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
 
index e2d7912..aaff5b3 100644 (file)
@@ -231,7 +231,7 @@ class ir_cron(osv.osv):
                 _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:
index 4b56ae0..ff43a15 100644 (file)
@@ -568,7 +568,6 @@ class ir_model_relation(Model):
         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
@@ -1074,7 +1073,6 @@ class ir_model_data(osv.osv):
                                 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)])
index f6f9e58..13035f4 100644 (file)
@@ -140,7 +140,7 @@ class ir_sequence(openerp.osv.osv.osv):
         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):
index af7751c..8b9d44d 100644 (file)
@@ -417,7 +417,7 @@ class ir_values(osv.osv):
                                 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())
 
index 2ac677b..4e2f30c 100644 (file)
@@ -96,7 +96,7 @@ def graph_get(cr, graph, wkf_ids, nested, workitem, processed_subflows):
         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)
@@ -109,7 +109,6 @@ def graph_get(cr, graph, wkf_ids, nested, workitem, processed_subflows):
 
 
 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()
 
@@ -171,7 +170,7 @@ showpage'''
                         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