From 207c4dda5c13084071e45d86a2db63a94531883d Mon Sep 17 00:00:00 2001 From: emilkholod Date: Sun, 11 Apr 2021 07:00:32 +0000 Subject: [PATCH] [FIX] account : Fix error on `search_read` for `account.move.line` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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) --- addons/account/models/account_move.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index f1b195b40ea..f1054cc1073 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -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: