[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
This commit is contained in:
wan
2018-12-12 13:31:19 +00:00
parent 9c4eab3ef4
commit 7854c651e3
+2
View File
@@ -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),