[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:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user