summaryrefslogtreecommitdiff
path: root/openerp/modules/loading.py
diff options
context:
space:
mode:
authorVo Minh Thu <vmt@openerp.com>2012-12-14 15:11:14 +0100
committerVo Minh Thu <vmt@openerp.com>2012-12-14 15:11:14 +0100
commit08a082f63fb9b2d86ae62932d83ca535d1684b59 (patch)
tree8f1d44d7ba5007bd3d9f2ec28b3ec3c02b6adbd6 /openerp/modules/loading.py
parent3667e3c6190d8a22e358bfd2eac48e0cdca9a8a3 (diff)
[FIX] registry: Set the fields_by_model attribute in __init__(), use None to flag non-existing fields-per-model cache.
bzr revid: vmt@openerp.com-20121214141114-em9r66e3sfy21t2r
Diffstat (limited to 'openerp/modules/loading.py')
-rw-r--r--openerp/modules/loading.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/openerp/modules/loading.py b/openerp/modules/loading.py
index b4ad08af7a1..935ea8a2436 100644
--- a/openerp/modules/loading.py
+++ b/openerp/modules/loading.py
@@ -149,7 +149,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
# Query manual fields for all models at once and save them on the registry
# so the initialization code for each model does not have to do it
# one model at a time.
- pool.fields_by_model = {'so_this_dict_is_not_empty': {}}
+ pool.fields_by_model = {}
cr.execute('SELECT * FROM ir_model_fields WHERE state=%s', ('manual',))
for field in cr.dictfetchall():
pool.fields_by_model.setdefault(field['model'], []).append(field)
@@ -232,7 +232,7 @@ def load_module_graph(cr, graph, status=None, perform_checks=True, skip_modules=
# The query won't be valid for models created later (i.e. custom model
# created after the registry has been loaded), so empty its result.
- pool.fields_by_model = {}
+ pool.fields_by_model = None
cr.commit()