Fix Travis errors

This commit is contained in:
Pedro M. Baeza
2014-08-04 21:05:19 +02:00
parent b94bebee0e
commit b522f28ffb
23 changed files with 36 additions and 82 deletions

View File

@@ -19,23 +19,21 @@
#
##############################################################################
from openerp.osv.orm import Model
from openerp.osv import fields
from openerp.osv import orm
class account_move(Model):
class AccountMove(orm.Model):
_inherit = 'account.move'
def unlink(self, cr, uid, ids, context=None):
"""
Delete the reconciliation when we delete the moves. This
"""Delete the reconciliation when we delete the moves. This
allow an easier way of cancelling the bank statement.
"""
reconcile_to_delete = []
reconcile_obj = self.pool.get('account.move.reconcile')
reconcile_obj = self.pool['account.move.reconcile']
for move in self.browse(cr, uid, ids, context=context):
for move_line in move.line_id:
if move_line.reconcile_id:
reconcile_to_delete.append(move_line.reconcile_id.id)
reconcile_obj.unlink(cr, uid, reconcile_to_delete, context=context)
return super(account_move, self).unlink(cr, uid, ids, context=context)
return super(AccountMove, self).unlink(cr, uid, ids, context=context)