From 536f7fe57fd729b94929a7e5f01cc719c807ac2e Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Fri, 26 Apr 2013 14:25:01 +0200 Subject: [PATCH] [IMP] use _auto_init's context key to force creating manual fields --- unserialize_field/ir_model_fields.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/unserialize_field/ir_model_fields.py b/unserialize_field/ir_model_fields.py index 78244bd1d..16c44d1d6 100644 --- a/unserialize_field/ir_model_fields.py +++ b/unserialize_field/ir_model_fields.py @@ -33,7 +33,6 @@ class ir_model_fields(Model): for this in self.browse(cr, uid, ids, context=context): pool_obj = self.pool.get(this.model_id.model) self.create_database_column(cr, uid, pool_obj, this.name) - this.write({'state': 'manual'}) while True: ids = pool_obj.search( cr, uid, @@ -54,7 +53,7 @@ class ir_model_fields(Model): old = pool_obj._columns[field_name] field_declaration_args = [] field_declaration_kwargs = dict( - manual=False, + manual=old.manual, string=old.string, required=old.required, readonly=old.readonly, @@ -88,7 +87,7 @@ class ir_model_fields(Model): **field_declaration_kwargs) pool_obj._columns[field_name] = field_declaration - pool_obj._auto_init(cr, {}) + pool_obj._auto_init(cr, {'update_custom_fields': True}) def unserialize_field(self, cr, uid, pool_obj, read_record, serialization_field_name, field_name,