diff options
| author | Aaron Bohy <aab@odoo.com> | 2018-12-06 14:41:33 +0000 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2018-12-07 13:16:07 +0000 |
| commit | b1ef0001f61d29fc3d3be384422c0fb35a09806f (patch) | |
| tree | 17890fff2ac46b121c4426193d9e49ea06977c29 /addons/base_import/static | |
| parent | 40dd121938552d3f88289d2e5fcd1d57a0dd01bb (diff) | |
[REF] *: adapt all client actions
to ControlPanel/Search view refactoring.
The ControlPanel being now inside the DOM of client actions, those
existing widgets needed to be adapted (in the way they define if
and how they want a ControlPanel, and in the way the manipulate
their DOM as it slightly changed). Tests needed to be adapted as
well.
Part of task 1893568
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Diffstat (limited to 'addons/base_import/static')
| -rw-r--r-- | addons/base_import/static/src/js/import_action.js | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/addons/base_import/static/src/js/import_action.js b/addons/base_import/static/src/js/import_action.js index c093987bc8e..83259b30252 100644 --- a/addons/base_import/static/src/js/import_action.js +++ b/addons/base_import/static/src/js/import_action.js @@ -2,7 +2,6 @@ odoo.define('base_import.import', function (require) { "use strict"; var AbstractAction = require('web.AbstractAction'); -var ControlPanelMixin = require('web.ControlPanelMixin'); var core = require('web.core'); var session = require('web.session'); var time = require('web.time'); @@ -72,8 +71,9 @@ function dataFilteredQuery(q) { q.callback({results: suggestions}); } -var DataImport = AbstractAction.extend(ControlPanelMixin, { - template: 'ImportView', +var DataImport = AbstractAction.extend({ + hasControlPanel: true, + contentTemplate: 'ImportView', opts: [ {name: 'encoding', label: _lt("Encoding:"), value: ''}, {name: 'separator', label: _lt("Separator:"), value: ''}, @@ -137,7 +137,7 @@ var DataImport = AbstractAction.extend(ControlPanelMixin, { // import object id this.id = null; this.session = session; - action.display_name = _t('Import a File'); // Displayed in the breadcrumbs + this._title = _t('Import a File'); // Displayed in the breadcrumbs this.do_not_change_match = false; }, /** @@ -145,13 +145,14 @@ var DataImport = AbstractAction.extend(ControlPanelMixin, { */ willStart: function () { var self = this; - return this._rpc({ + var def = this._rpc({ model: this.res_model, method: 'get_import_templates', context: this.parent_context, }).then(function (result) { self.importTemplates = result; }); + return $.when(this._super.apply(this, arguments), def); }, start: function () { var self = this; @@ -170,7 +171,7 @@ var DataImport = AbstractAction.extend(ControlPanelMixin, { var status = { cp_content: {$buttons: self.$buttons}, }; - self.update_control_panel(status); + self.updateControlPanel(status); }) ); }, @@ -189,7 +190,7 @@ var DataImport = AbstractAction.extend(ControlPanelMixin, { this.$buttons.filter('.o_import_import').on('click', this.import.bind(this)); this.$buttons.filter('.o_import_file_reload').on('click', this.loaded_file.bind(this)); this.$buttons.filter('.oe_import_file').on('click', function () { - self.$('.oe_import_file').click(); + self.$('.o_content .oe_import_file').click(); }); this.$buttons.filter('.o_import_cancel').on('click', function(e) { e.preventDefault(); |
