From 7854c651e3c3558c19249d042cf50c685c639229 Mon Sep 17 00:00:00 2001 From: wan Date: Wed, 12 Dec 2018 13:31:19 +0000 Subject: [PATCH] [FIX] account: fix _toggle_reconcile_to_false() on empty recordset When the method _toggle_reconcile_to_false was called on an empty recordset (e.g existing account is imported with reconcile=False and the field was already False), an SQL error was raised. Fixes #29326 closes odoo/odoo#29458 --- addons/account/models/account.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 6c7d88b11f5..d7613478ce6 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -290,6 +290,8 @@ class AccountAccount(models.Model): Note that it is disallowed if some lines are partially reconciled. ''' + if not self.ids: + return None partial_lines_count = self.env['account.move.line'].search_count([ ('account_id', 'in', self.ids), ('full_reconcile_id', '=', False),