diff options
| author | Xavier Morel <xmo@openerp.com> | 2011-11-09 16:11:33 +0100 |
|---|---|---|
| committer | Xavier Morel <xmo@openerp.com> | 2011-11-09 16:11:33 +0100 |
| commit | 4635ef654cadc04f197df05eb901adca306914ff (patch) | |
| tree | 93bb5915a4f5825e59df4d3659569c322ff9c337 | |
| parent | 08ee7f63cf213b6ae3bf21bdddb998f3d26944dd (diff) | |
[FIX] always remove database ID from import-compatible exports
bzr revid: xmo@openerp.com-20111109151133-xchgr9jr507jtv98
| -rw-r--r-- | addons/web/controllers/main.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 74285b1f444..12c39d71a06 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -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 |
