From 93c92c72e84c8802af4c698ba0a681c25113cec4 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Wed, 8 Aug 2018 16:16:34 +0200 Subject: [PATCH] [IMP] account: Hide 'Import' button on bank statements list view Purpose ======= It's way more complicated than the dedicated import mechanism on the dashboard NB: There are still no way to hide the import button in a generic way. This kind of ugly hack has already been done in https://github.com/odoo/enterprise/blob/master/sign/static/src/js/sign_backend.js#L53 This should be removed as soon as such a mechanism arrives. TaskID: 1861619 --- addons/account/static/src/js/bank_statement.js | 18 ++++++++++++++++++ addons/account/views/account.xml | 1 + 2 files changed, 19 insertions(+) create mode 100644 addons/account/static/src/js/bank_statement.js diff --git a/addons/account/static/src/js/bank_statement.js b/addons/account/static/src/js/bank_statement.js new file mode 100644 index 00000000000..4b5be241754 --- /dev/null +++ b/addons/account/static/src/js/bank_statement.js @@ -0,0 +1,18 @@ +odoo.define('account.bank_statement', function(require) { + "use strict"; + + var KanbanController = require("web.KanbanController"); + var ListController = require("web.ListController"); + + var includeDict = { + renderButtons: function () { + this._super.apply(this, arguments); + if (this.modelName === "account.bank.statement") { + this.$buttons.find('button.o_button_import').hide(); + } + } + }; + + KanbanController.include(includeDict); + ListController.include(includeDict); +}); \ No newline at end of file diff --git a/addons/account/views/account.xml b/addons/account/views/account.xml index 348e6fdeec2..369a272b874 100644 --- a/addons/account/views/account.xml +++ b/addons/account/views/account.xml @@ -23,6 +23,7 @@ +