[FIX] ir_model_fields: when adding a new custom column to a custom model, set a valid...
authorMartin Trigaux <mat@openerp.com>
Thu, 15 May 2014 14:25:51 +0000 (16:25 +0200)
committerMartin Trigaux <mat@openerp.com>
Thu, 15 May 2014 14:25:51 +0000 (16:25 +0200)
openerp/addons/base/ir/ir_model.py

index d716227..9614e2d 100644 (file)
@@ -351,6 +351,8 @@ class ir_model_fields(osv.osv):
                 raise except_orm(_('Error'), _("Model %s does not exist!") % vals['relation'])
 
             if self.pool.get(vals['model']):
+                if vals['model'].startswith('x_') and vals['name'] == 'x_name':
+                    self.pool[vals['model']]._rec_name = 'x_name'
                 self.pool.get(vals['model']).__init__(self.pool, cr)
                 #Added context to _auto_init for special treatment to custom field for select_level
                 ctx = dict(context,