diff --git a/account_reconcile_model_oca/models/account_reconcile_model.py b/account_reconcile_model_oca/models/account_reconcile_model.py index 53eb028e..4963abe1 100644 --- a/account_reconcile_model_oca/models/account_reconcile_model.py +++ b/account_reconcile_model_oca/models/account_reconcile_model.py @@ -369,7 +369,7 @@ class AccountReconcileModel(models.Model): # Exact tokens. if len(tokens) == 1: - exact_tokens.append(tokens[0]) + exact_tokens.append(text_value) return numerical_tokens, exact_tokens, text_tokens def _get_invoice_matching_amls_candidates(self, st_line, partner): diff --git a/account_reconcile_model_oca/tests/test_reconciliation_match.py b/account_reconcile_model_oca/tests/test_reconciliation_match.py index 8ee89599..a51cc29f 100644 --- a/account_reconcile_model_oca/tests/test_reconciliation_match.py +++ b/account_reconcile_model_oca/tests/test_reconciliation_match.py @@ -1439,6 +1439,17 @@ class TestReconciliationMatchingRules(AccountTestInvoicingCommon): {}, ) + with rollback(): + # Test Matching on exact_token. + term_line.name = "PAY-123" + st_line.payment_ref = "PAY-123" + + # Matching if no checkbox checked. + self.assertDictEqual( + rule._apply_rules(st_line, None), + {"amls": term_line, "model": rule}, + ) + with self.subTest( rule_field="match_text_location_label", st_line_field="payment_ref" ):