diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2017-01-04 14:44:38 +0100 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2017-01-19 16:24:53 +0100 |
| commit | 734d9b56da5c57900171ee33b7aea3dbc1ece506 (patch) | |
| tree | 7e3a7e6806cc537d1615bdeb8828a7e2e37a32c3 /addons | |
| parent | ebda1abec40f40580a7da1e511164f0ec77d7a62 (diff) | |
[FIX] web: conserve /id for saved export list
With 003d85b instead of getting the name of the relation
field_relation we get field_relation/id.
But the data about the related fields are not gotten all at once when
opening the export modal. They are gotten by clicking on the arrow of
the related record.
So we need to have these /id information saved in the export list,
otherwise for example the related records can be missing when exporting
from an export list, whilst everything was OK without using the saved
export list.
With the previous change, an export list could contain an id and .id
fields for the same relational field, so a change must also be done in
fields_info method used when getting a saved list.
opw-665994
opw-693535
note: adapted forward-port of 8.0's 29be9ae80 which was lost when
merging web enterprise onto web community.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web/controllers/main.py | 2 | ||||
| -rw-r--r-- | addons/web/static/src/js/widgets/data_export.js | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 2eafb325882..c209cdfdff9 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1234,7 +1234,7 @@ class Export(http.Controller): info = {} fields = self.fields_get(model) if ".id" in export_fields: - fields['.id'] = fields.pop('id', {'string': 'ID'}) + fields['.id'] = fields.get('id', {'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 diff --git a/addons/web/static/src/js/widgets/data_export.js b/addons/web/static/src/js/widgets/data_export.js index 14cdc4c5e3e..8b07fd1f632 100644 --- a/addons/web/static/src/js/widgets/data_export.js +++ b/addons/web/static/src/js/widgets/data_export.js @@ -394,6 +394,7 @@ var DataExport = Dialog.extend({ }, add_field: function(field_id, string) { var $field_list = this.$('.o_fields_list'); + field_id = this.records[field_id].value || field_id; if($field_list.find("option[value='" + field_id + "']").length === 0) { $field_list.append(new Option(string, field_id)); } |
