[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
This commit is contained in:
goliveirab
2018-11-29 21:23:47 +00:00
parent 82a1e1dcc3
commit fd9b2c9f36
+2
View File
@@ -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