mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[ADD] account_bank_statement_reopen_shop_undo_reconciliation
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
from . import account_bank_statement
|
||||
from . import account_bank_statement_line
|
||||
from . import account_move_line
|
||||
from . import account_move
|
||||
@@ -0,0 +1,15 @@
|
||||
# Copyright 2022 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# Copyright 2022 ForgeFlow S.L.
|
||||
# @author Jordi Ballester <jordi.ballester@forgeflow.com.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountBankStatement(models.Model):
|
||||
_inherit = "account.bank.statement"
|
||||
|
||||
def button_reopen(self):
|
||||
self = self.with_context(skip_undo_reconciliation=True)
|
||||
return super(AccountBankStatement, self).button_reopen()
|
||||
@@ -0,0 +1,20 @@
|
||||
# Copyright 2022 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
# Copyright 2022 ForgeFlow S.L.
|
||||
# @author Jordi Ballester <jordi.ballester@forgeflow.com.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountBankStatementLine(models.Model):
|
||||
_inherit = "account.bank.statement.line"
|
||||
|
||||
def button_undo_reconciliation(self):
|
||||
if self._context.get("skip_undo_reconciliation"):
|
||||
return
|
||||
res = super(AccountBankStatementLine, self).button_undo_reconciliation()
|
||||
if self.statement_id.state == "open":
|
||||
self.move_id.button_draft()
|
||||
return res
|
||||
@@ -0,0 +1,13 @@
|
||||
# Copyright 2022 ForgeFlow S.L.
|
||||
# @author Jordi Ballester <jordi.ballester@forgeflow.com.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = "account.move"
|
||||
|
||||
def button_draft(self):
|
||||
moves_to_draft = self.filtered(lambda m: not m.statement_line_id.is_reconciled)
|
||||
return super(AccountMove, moves_to_draft).button_draft()
|
||||
@@ -0,0 +1,14 @@
|
||||
# Copyright 2022 ForgeFlow S.L.
|
||||
# @author Jordi Ballester <jordi.ballester@forgeflow.com.com>
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountMoveLine(models.Model):
|
||||
_inherit = "account.move.line"
|
||||
|
||||
def remove_move_reconcile(self):
|
||||
if self._context.get("skip_undo_reconciliation"):
|
||||
return True
|
||||
return super(AccountMoveLine, self).remove_move_reconcile()
|
||||
Reference in New Issue
Block a user