From fd9b2c9f36bb758cf7b27f2be25ede45fae137f9 Mon Sep 17 00:00:00 2001 From: goliveirab Date: Thu, 29 Nov 2018 21:23:47 +0000 Subject: [PATCH] [FIX] account: Bad query Fix Error: `ERROR: syntax error at or near ")" LINE 7: ... WHERE full_reconcile_id IS NULL and account_id IN ()` This can occurs when: - using write to some account like: `some_account.write({'reconcile': True})` closes odoo/odoo#29164 --- 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 373ec1fe9fb..6c7d88b11f5 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -273,6 +273,8 @@ class AccountAccount(models.Model): Note that: lines with debit = credit = amount_currency = 0 are set to `reconciled´ = True ''' + if not self.ids: + return None query = """ UPDATE account_move_line SET reconciled = CASE WHEN debit = 0 AND credit = 0 AND amount_currency = 0