[FIX] ir_model: fix create/update/delete custom fields
authorRaphael Collet <rco@openerp.com>
Tue, 4 Nov 2014 10:37:56 +0000 (11:37 +0100)
committerRaphael Collet <rco@openerp.com>
Tue, 4 Nov 2014 13:52:13 +0000 (14:52 +0100)
commit3adbb49ec0f57851534d103b7c42996d0679b10b
tree798ebf80c7368452a3c6cca7df48af7ca411a009
parentd50d89566c946889c0000852d70fe4811243d61b
[FIX] ir_model: fix create/update/delete custom fields

Creating custom fields would crash on a model that has a related field without
string.  The crash was caused by the field not being set up, and method
BaseModel._field_create() violating a non-null constraint on the field string.
This has been fixed by setting up fields before updating ir_model_fields.

Deleting a custom field could also cause trouble when that field is inherited
in a child model.  In that case, the registry was simply no longer consistent.
The fix is to reload completely the registry.

The modification of custom fields was not reflected on field objects.  The fix
applies changes on fields before updating columns accordingly.
openerp/addons/base/ir/ir_model.py