Merge PR #496 into 13.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2022-09-20 15:17:20 +00:00

View File

@@ -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: