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 account_move_reconcile_forbid_cancel 13.0.1.0.2
This commit is contained in:
committed by
Alejandro Ji Cheung
parent
c856cad6f7
commit
d0b6d703c2
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "Account Move Reconcile Forbid Cancel",
|
||||
"version": "13.0.1.0.1",
|
||||
"version": "13.0.1.0.2",
|
||||
"category": "Finance",
|
||||
"website": "https://github.com/OCA/account-reconcile",
|
||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||
|
||||
@@ -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