From 08ebf2cf616fa2fb982baeaeab3e031a1431fa7a Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Fri, 9 Sep 2016 14:37:11 +0200 Subject: [PATCH] [FIX] service: initialize_db: correctly set country When we are creating a database with a country code from the database manager, the country is not set in the company, so when we install the accounting app, there is no chart of account installed by default. We have this bug because we are trying to put a country id in a field that should receive a 'res.country' record. To fix this bug, we change the call of function read_search by a search that will return a recordset. Bug introduced in rev https://github.com/odoo/odoo/commit/1b59643d4b96195edcdbe1b1168a11a3b6d85483 --- odoo/service/db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/service/db.py b/odoo/service/db.py index b2944e958bc..d6ff8d15976 100644 --- a/odoo/service/db.py +++ b/odoo/service/db.py @@ -56,7 +56,7 @@ def _initialize_db(id, db_name, demo, lang, user_password, login='admin', countr modules.update_translations(lang) if country_code: - countries = env['res.country'].search_read([('code', 'ilike', country_code)], fields=['id']) + countries = env['res.country'].search([('code', 'ilike', country_code)]) if countries: env['res.company'].browse(1).country_id = countries[0]