[FIX] ir_model: invalidate cache when adding new fields
authorMartin Trigaux <mat@openerp.com>
Thu, 21 Aug 2014 13:27:31 +0000 (15:27 +0200)
committerMartin Trigaux <mat@openerp.com>
Thu, 21 Aug 2014 15:24:45 +0000 (17:24 +0200)
commit0ab88f54f9b5e6c2396f7a612dc2df1f94ff0c09
treed4fab21c5e679daaa768e9dd74ee7bf3d8303752
parent8fe9f07cac96a1001761666a7f92ec955660cbfd
[FIX] ir_model: invalidate cache when adding new fields

When a new ir.model.field is created, add the new field in the fields_by_model (cache of custom fields). This is required as the __init__ method would not retrieve the new field if fields_by_model is already set.
Otherwise, the _columns would not contain the new fields and we could not access it without restarting the server (e.g. the installation of a module adds ir.model.fields and use it in the a view.
openerp/addons/base/ir/ir_model.py
openerp/addons/base/tests/__init__.py
openerp/addons/base/tests/test_ir_model.py [new file with mode: 0644]