[FIX] always remove database ID from import-compatible exports
bzr revid: xmo@openerp.com-20111109151133-xchgr9jr507jtv98
This commit is contained in:
parent
08ee7f63cf
commit
4635ef654c
|
@ -1199,7 +1199,11 @@ class Export(View):
|
|||
fields = {}
|
||||
else:
|
||||
fields = self.fields_get(req, model)
|
||||
fields['.id'] = fields.pop('id') if 'id' in fields else {'string': 'ID'}
|
||||
|
||||
if import_compat:
|
||||
fields.pop('id', None)
|
||||
else:
|
||||
fields['.id'] = fields.pop('id', {'string': 'ID'})
|
||||
|
||||
fields_sequence = sorted(fields.iteritems(),
|
||||
key=lambda field: field[1].get('string', ''))
|
||||
|
@ -1249,7 +1253,6 @@ class Export(View):
|
|||
def fields_info(self, req, model, export_fields):
|
||||
info = {}
|
||||
fields = self.fields_get(req, model)
|
||||
fields['.id'] = fields.pop('id') if 'id' in fields else {'string': 'ID'}
|
||||
|
||||
# To make fields retrieval more efficient, fetch all sub-fields of a
|
||||
# given field at the same time. Because the order in the export list is
|
||||
|
|
Loading…
Reference in New Issue