From 5788ee8a1cc903431b100a3861686cfa606aa620 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 29 May 2017 14:09:18 +0200 Subject: [FIX] web: prevent crash when exporting all data In the list controller, some code to determine the active domain to export was causing a crash. It was easy to see: just select all records in a list view, then click on 'Export' in the sidebar. Note that the data_export code is still quite old, and did evolve organically. It does not conform to our new design principles, in particular, the way component should communicate. But this is a task for another day. --- addons/web/static/src/js/widgets/data_export.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/widgets/data_export.js') diff --git a/addons/web/static/src/js/widgets/data_export.js b/addons/web/static/src/js/widgets/data_export.js index 13ab8fd0892..c11551ca2cc 100644 --- a/addons/web/static/src/js/widgets/data_export.js +++ b/addons/web/static/src/js/widgets/data_export.js @@ -295,7 +295,10 @@ var DataExport = Dialog.extend({ } var self = this; - return this.exports.read_slice(['name'], { + return this._rpc({ + model: 'ir.exports', + method: 'search_read', + fields: ['name'], domain: [['resource', '=', this.record.model]] }).then(function (export_list) { if (!export_list.length) { -- cgit v1.2.3