Merge pull request #174 from akretion/14.0-improve-bank-statement-reset-to-draft

14.0 improve bank statement reset to draft
This commit is contained in:
beau sebastien
2022-07-04 09:58:04 +02:00
committed by GitHub
3 changed files with 717 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()