[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) <nle@odoo.com>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user