diff options
| author | Pierre Masereel <pim@odoo.com> | 2016-09-09 14:37:11 +0200 |
|---|---|---|
| committer | Pierre Masereel <pim@odoo.com> | 2016-09-09 15:39:40 +0200 |
| commit | 08ebf2cf616fa2fb982baeaeab3e031a1431fa7a (patch) | |
| tree | a2c67c8e2ea422b898b46f3304917320e428f111 | |
| parent | a5125cd1c4b3059edb479e02fc1388eaecf281da (diff) | |
[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
| -rw-r--r-- | odoo/service/db.py | 2 |
1 files changed, 1 insertions, 1 deletions
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] |
