From 75c624e2116a5a559e01fddc4709806d1a02e458 Mon Sep 17 00:00:00 2001 From: "Andrea Grazioso (agr-odoo)" Date: Wed, 27 May 2020 13:56:02 +0000 Subject: [PATCH] [FIX] account: disable Amount Matching when invisible Go to Reconciliation Models > Invoices Matching Rule Set the parameter 'Amount Matching' Set 'Partner Is Set & Matches' Save Edit Unset 'Partner Is Set & Matches' 'Amount Matching' will switch to invisible but is not disabled opw-2261134 closes odoo/odoo#52048 X-original-commit: 61f1ca63e5dc27e06c855bb09b18bf4897e8ab1f Signed-off-by: Nicolas Martinelli (nim) --- addons/account/models/account_reconcile_model.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/account/models/account_reconcile_model.py b/addons/account/models/account_reconcile_model.py index f0228acd0bd..b65f9ca9ebc 100644 --- a/addons/account/models/account_reconcile_model.py +++ b/addons/account/models/account_reconcile_model.py @@ -207,6 +207,11 @@ class AccountReconcileModel(models.Model): if self.match_total_amount_param < 0 or self.match_total_amount_param > 100: self.match_total_amount_param = min(max(0, self.match_total_amount_param), 100) + @api.onchange('match_partner') + def _onchange_match_partner(self): + if not self.match_partner: + self.match_total_amount = False + #################################################### # RECONCILIATION PROCESS ####################################################