mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
[IMP] account_move_reconcile_forbid_cancel: Add context to skip restriction (P.E. payment orders)
TT38927 TT39037
This commit is contained in:
@@ -14,8 +14,9 @@ class AccountMove(models.Model):
|
||||
)
|
||||
|
||||
def button_draft(self):
|
||||
if not tools.config["test_enable"] or self.env.context.get(
|
||||
"test_reconcile_forbid_cancel"
|
||||
if not self.env.context.get("skip_reconcile_forbid_cancel") and (
|
||||
not tools.config["test_enable"]
|
||||
or self.env.context.get("test_reconcile_forbid_cancel")
|
||||
):
|
||||
rec_pay_lines = self._get_receivable_payable_lines()
|
||||
if rec_pay_lines.matched_debit_ids or rec_pay_lines.matched_credit_ids:
|
||||
@@ -25,8 +26,9 @@ class AccountMove(models.Model):
|
||||
super().button_draft()
|
||||
|
||||
def button_cancel(self):
|
||||
if not tools.config["test_enable"] or self.env.context.get(
|
||||
"test_reconcile_forbid_cancel"
|
||||
if not self.env.context.get("skip_reconcile_forbid_cancel") and (
|
||||
not tools.config["test_enable"]
|
||||
or self.env.context.get("test_reconcile_forbid_cancel")
|
||||
):
|
||||
rec_pay_lines = self._get_receivable_payable_lines()
|
||||
if rec_pay_lines.matched_debit_ids or rec_pay_lines.matched_credit_ids:
|
||||
|
||||
Reference in New Issue
Block a user