summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorwan <wan@odoo.com>2019-09-26 10:38:44 +0000
committerwan <wan@odoo.com>2019-09-27 09:19:38 +0000
commit40f0c28d5efddfcc28b0a99d06254572bb458f3e (patch)
tree351fd0f9607367115e8d6141b6cf6318043382fe /addons
parentd745c4ee4da10f15baea8070c988c15d703f1881 (diff)
[IMP] account: fix reconciliation model matching on note and transaction type
Before, all fields were looking at the name of the statement line
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_reconcile_model.py8
1 files 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.