[FIX] account : Fix error on search_read for account.move.line

* If `where_clause` is empty, then there will be an error. This commit fixes that.

closes odoo/odoo#69100

X-original-commit: f0a1bb3692e17334850fed4f22444f47992adb78
Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
emilkholod
2021-04-11 11:56:15 +00:00
parent 3d5101fa18
commit 207c4dda5c
+1 -1
View File
@@ -3713,7 +3713,7 @@ class AccountMoveLine(models.Model):
)
FROM %(from)s
WHERE %(where)s
""" % {'from': from_clause, 'where': where_clause, 'order_by': order_string}
""" % {'from': from_clause, 'where': where_clause or 'TRUE', 'order_by': order_string}
self.env.cr.execute(sql, where_clause_params)
result = {r[0]: r[1] for r in self.env.cr.fetchall()}
for record in self: