[IMP] account, base_calendar, stock: another round of cr.commit() cleanup. One should never call cr.commit() explicitly unless after having created a dedicated cursor (and you should only do that in very rare cases, if ever). Please let the framework handle the transactions!

bzr revid: odo@openerp.com-20100712142859-306guxucojj6q358
This commit is contained in:
Olivier Dony
2010-07-12 16:28:59 +02:00
parent dee48130c7
commit 2c5ed4adad
3 changed files with 0 additions and 4 deletions
-1
View File
@@ -482,7 +482,6 @@ class account_move_line(osv.osv):
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'account_move_line_journal_id_period_id_index\'')
if not cr.fetchone():
cr.execute('CREATE INDEX account_move_line_journal_id_period_id_index ON account_move_line (journal_id, period_id)')
cr.commit()
def _check_no_view(self, cr, uid, ids):
lines = self.browse(cr, uid, ids)
-2
View File
@@ -690,7 +690,6 @@ true, it will allow you to hide the event alarm information without removing it.
cr.execute('Update %s set base_calendar_alarm_id=%s, alarm_id=%s \
where id=%s' % (model_obj._table, \
alarm_id, basic_alarm.id, data.id))
cr.commit()
return True
def do_alarm_unlink(self, cr, uid, ids, model, context=None):
@@ -714,7 +713,6 @@ true, it will allow you to hide the event alarm information without removing it.
alarm_obj.unlink(cr, uid, alarm_ids)
cr.execute('Update %s set base_calendar_alarm_id=NULL, alarm_id=NULL\
where id=%s' % (model_obj._table, datas.id))
cr.commit()
return True
res_alarm()
-1
View File
@@ -1451,7 +1451,6 @@ class stock_move(osv.osv):
if not cursor.fetchone():
cursor.execute('CREATE INDEX stock_move_location_id_location_dest_id_product_id_state \
ON stock_move (location_id, location_dest_id, product_id, state)')
cursor.commit()
return res
def onchange_lot_id(self, cr, uid, ids, prodlot_id=False, product_qty=False,