From ccc9dae47ef5830deb4b7d0c974cf519387232a9 Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Mon, 18 Jul 2016 14:06:10 +0200 Subject: [PATCH] [FIX] account: return correct values for default call In the new API, default calls are supposed to return recordset (even empty recordset), not bool values for relationnal fields. If the table for this model was already present and if no l10n_x was installed, no default value could be computed correctly for existing entries. This caused a crash on install. opw-683470 --- addons/account/models/account_bank_statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index 3c24afa39c6..62c6f2a997a 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -101,7 +101,7 @@ class AccountBankStatement(models.Model): journals = self.env['account.journal'].search([('type', '=', journal_type), ('company_id', '=', company_id)]) if journals: return journals[0] - return False + return self.env['account.journal'] @api.multi def _get_opening_balance(self, journal_id):