[FIX] account: Fix missing parenthesis in query

The OR in query was ignoring the previous AND making the query returning randomly partners not linked to the current journal item.

closes odoo/odoo#103340

X-original-commit: 174d117a30f3a70e7993ea75816de381dda0fa6b
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
This commit is contained in:
Laurent Smet
2022-10-18 11:21:13 +02:00
parent 8f7565601c
commit d15ff0818d
@@ -663,7 +663,7 @@ class AccountBankStatementLine(models.Model):
aml.partner_id = partner.id
AND partner.name IS NOT NULL
AND partner.active
AND (''' + ') OR ('.join(sub_queries) + ''')
AND ((''' + ') OR ('.join(sub_queries) + '''))
WHERE aml.company_id = %s
LIMIT 1
''',