From 40f0c28d5efddfcc28b0a99d06254572bb458f3e Mon Sep 17 00:00:00 2001 From: wan Date: Thu, 26 Sep 2019 10:38:44 +0000 Subject: [PATCH] [IMP] account: fix reconciliation model matching on note and transaction type Before, all fields were looking at the name of the statement line --- addons/account/models/account_reconcile_model.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/models/account_reconcile_model.py b/addons/account/models/account_reconcile_model.py index 147c8334a67..6fa63faf8c0 100644 --- a/addons/account/models/account_reconcile_model.py +++ b/addons/account/models/account_reconcile_model.py @@ -401,15 +401,15 @@ class AccountReconcileModel(models.Model): params += [rule.match_amount_min, rule.match_amount_max] # Filter on label, note and transaction_type - for field in ['label', 'note', 'transaction_type']: + for field, column in [('label', 'name'), ('note', 'note'), ('transaction_type', 'transaction_type')]: if rule['match_' + field] == 'contains': - query += ' AND st_line.name ILIKE %s' + query += ' AND st_line.{} ILIKE %s'.format(column) params += ['%%%s%%' % rule['match_' + field + '_param']] elif rule['match_' + field] == 'not_contains': - query += ' AND st_line.name NOT ILIKE %s' + query += ' AND st_line.{} NOT ILIKE %s'.format(column) params += ['%%%s%%' % rule['match_' + field + '_param']] elif rule['match_' + field] == 'match_regex': - query += ' AND st_line.name ~* %s' + query += ' AND st_line.{} ~* %s'.format(column) params += [rule['match_' + field + '_param']] # Filter on partners.