[FIX] base: keep the model cache consistent

Do not remove fields from models except for custom fields.  Removing a base
field from a model screws up the model cache: that field may be required to
speed up the setup of the model in another registry.
This commit is contained in:
Raphael Collet
2017-08-18 13:44:00 +02:00
parent 27b46f3ba5
commit 0d73dae9ef
+2 -1
View File
@@ -420,7 +420,8 @@ class ir_model_fields(osv.osv):
if field.state == 'manual' and field.ttype == 'many2many':
rel_name = field.relation_table or model._fields[field.name].relation
tables_to_drop.add(rel_name)
model._pop_field(cr, uid, field.name, context=context)
if field.state == 'manual':
model._pop_field(cr, uid, field.name, context=context)
if tables_to_drop:
# drop the relation tables that are not used by other fields