account_usability: reset to draft the bank statement do not unreconcile

This commit is contained in:
Sébastien BEAU
2022-05-02 16:25:09 +02:00
committed by Kev-Roche
parent fde3dfae10
commit 85f8fe5b30
2 changed files with 21 additions and 0 deletions

View File

@@ -42,6 +42,13 @@ class AccountBankStatement(models.Model):
res.append((statement.id, name))
return res
def button_reopen(self):
self = self.with_context(skip_undo_reconciliation=True)
return super().button_reopen()
def button_undo_reconciliation(self):
self.line_ids.button_undo_reconciliation()
class AccountBankStatementLine(models.Model):
_inherit = 'account.bank.statement.line'
@@ -88,3 +95,9 @@ class AccountBankStatementLine(models.Model):
'res_id': self.move_id.id,
})
return action
def button_undo_reconciliation(self):
if self._context.get("skip_undo_reconciliation"):
return
else:
return super().button_undo_reconciliation()