From 645d9dc037d856d002ad19d360ea621acba3ec19 Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Thu, 28 Feb 2019 08:57:45 +0000 Subject: [PATCH] [FIX] account: reconciliation widget partner domain all reconcile accounts Have an account move which lines have all the same partner Have a bank statement, without a partner Enter the reconciliation widget for the bank statement All the lines appear Select one of the lines of the account move for the partner Before this commit, all other lines disappeared from the proposition including the ones for the partner selected This cas because when having set a partner on the widget, only receivables and payables accounts were searched for After this commit, all account move lines for the partner are searched for OPW 1942936 closes odoo/odoo#31488 Signed-off-by: Lucas Perais (lpe) --- .../account/models/reconciliation_widget.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/addons/account/models/reconciliation_widget.py b/addons/account/models/reconciliation_widget.py index 36103ff196ad8..564ac75bda34c 100644 --- a/addons/account/models/reconciliation_widget.py +++ b/addons/account/models/reconciliation_widget.py @@ -455,21 +455,12 @@ def _domain_move_lines_for_reconciliation(self, st_line, aml_accounts, partner_i ('payment_id', '<>', False) ] - # Black lines = unreconciled & (not linked to a payment or open balance created by statement - domain_matching = [('reconciled', '=', False)] - if partner_id: - domain_matching = expression.AND([ - domain_matching, - [('account_id.internal_type', 'in', ['payable', 'receivable'])] - ]) - else: - # TODO : find out what use case this permits (match a check payment, registered on a journal whose account type is other instead of liquidity) - domain_matching = expression.AND([ - domain_matching, - [('account_id.reconcile', '=', True)] - ]) + # default domain matching + domain_matching = expression.AND([ + [('reconciled', '=', False)], + [('account_id.reconcile', '=', True)] + ]) - # Let's add what applies to both domain = expression.OR([domain_reconciliation, domain_matching]) if partner_id: domain = expression.AND([domain, [('partner_id', '=', partner_id)]])