[IMP] don't display deprecated fields in import window

bzr revid: xmo@openerp.com-20120926114235-iqkmi23yk2v1hq7w
This commit is contained in:
Xavier Morel 2012-09-26 13:42:35 +02:00
parent 627bb128e0
commit fd5d4e5dd3
1 changed files with 5 additions and 1 deletions

View File

@ -83,6 +83,10 @@ class ir_import(orm.TransientModel):
}]
fields_got = self.pool[model].fields_get(cr, uid, context=context)
for name, field in fields_got.iteritems():
# an empty string means the field is deprecated, @deprecated must
# be absent or False to mean not-deprecated
if field.get('deprecated', False) is not False:
continue
if field.get('readonly'):
states = field.get('states')
if not states:
@ -97,7 +101,7 @@ class ir_import(orm.TransientModel):
'id': name,
'name': name,
'string': field['string'],
# Y U NO ALWAYS HAVE REQUIRED
# Y U NO ALWAYS HAS REQUIRED
'required': bool(field.get('required')),
'fields': [],
}