[IMP] allow unreconciling bank statement lines by adding the cancel button

Since account_constraint forbids the deletion of account moves that
are linked to a bank statement, we add the possibility to delete them
from the bank statement itself, to provide a way to fix erroneous matches.
This commit is contained in:
Stéphane Bidoul
2014-10-24 19:26:24 +02:00
committed by Adrien Peiffer
parent b3544b026b
commit fcb6150d53
3 changed files with 31 additions and 1 deletions

View File

@@ -18,7 +18,7 @@
#
##############################################################################
from openerp import models, api
from openerp import models, api, fields
class AccountBankStatement(models.Model):
@@ -45,6 +45,14 @@ class AccountBankStatement(models.Model):
class AccountBankStatementLine(models.Model):
_inherit = "account.bank.statement.line"
state = fields.Selection(string='Statement state',
related='statement_id.state')
@api.multi
def cancel(self):
self = self.with_context(from_parent_object=True)
return super(AccountBankStatementLine, self).cancel()
@api.multi
def process_reconciliation(self, mv_line_dicts):
"""Add the from_parent_object key in context in order to be able