mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[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:
committed by
Adrien Peiffer
parent
b3544b026b
commit
fcb6150d53
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user