From 55e2138a4ef9f95c5726e7fea859b10daa74accc Mon Sep 17 00:00:00 2001 From: jvm-odoo Date: Tue, 5 Nov 2019 08:45:18 +0000 Subject: [PATCH] [FIX] account: fix cash bank statement import button Go on the accounting module, you'll find a kanban view with a few cards including "Bank" and "Cash". Click on the Cash card. The default import button doesn't appears because it is hidden. The reason of this hiding is that the bank statements of type "Bank" have a custom import method and the users where confuse. They didn't know which is the right button for the special import so we hid the default import button for the whole model. But there is also a "Cash" type bank statement who doesn't have that special import and his default import button is hidden too. This commit checks the type of the bank statement and hide the default import button only if the type is not "Cash". OPW-2090477 closes odoo/odoo#39829 X-original-commit: ee45228a8532b676729bc2be686814d616e5cbb5 Signed-off-by: Nicolas Lempereur (nle) --- addons/account/static/src/js/bank_statement.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/account/static/src/js/bank_statement.js b/addons/account/static/src/js/bank_statement.js index 4b5be241754..3ab8d935fd5 100644 --- a/addons/account/static/src/js/bank_statement.js +++ b/addons/account/static/src/js/bank_statement.js @@ -8,7 +8,10 @@ odoo.define('account.bank_statement', function(require) { renderButtons: function () { this._super.apply(this, arguments); if (this.modelName === "account.bank.statement") { - this.$buttons.find('button.o_button_import').hide(); + var data = this.model.get(this.handle); + if (data.context.journal_type !== 'cash') { + this.$buttons.find('button.o_button_import').hide(); + } } } };