Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty

In the odoo accounting module, there is an option to import bank statements. When the import is complete it automatically redirects you to the reconciliation view, but I want to redirect it to the accounting dashboard.


Looking I found that the redirection is done by this JavaScript code:

enterprise-13.0/account_bank_statement_import_csv/static/src/js/import_bank_stmt.js:58

exit: function () {

    this.do_action({

        name: _t("Reconciliation on Bank Statements"),

        context: {

            'statement_line_ids': this.statement_line_ids

        },

        type: 'ir.actions.client',

        tag: 'bank_statement_reconciliation_view'

    });

},


I have tried to modify the code to redirect to the accounting dashboard, but I have not been successful.

    exit: function () {

        var self = this;

        console.log("JavaScript redirection after importing");


        // var model_obj = new instance.web.Model('ir.model.data');

        // var view_id = false;

        // model_obj.call('get_object_reference', ['ir.ui.view', 'account.account_journal_dashboard_kanban_view']).then(function (result) {

        //     view_id = result[1];

        // });

        // console.log('view_id');

        // console.log(view_id);


        // this._rpc({

        //     model: 'account.move',

        //     method: 'redirect_return', // Python code that returns the data of the view action.

        // }).then(function (result) {

        //     self.do_action(result);

        // });


        this.do_action({

            name: _t("Reconciliation on Bank Statements"),

            context: {

                'statement_line_ids': this.statement_line_ids

            },

            type: 'ir.actions.client',

            tag: 'bank_statement_reconciliation_view'

        });

    },


Your help please.

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
toukok. 20
2667
3
marrask. 23
7533
2
lokak. 23
3651
1
lokak. 21
5462
2
helmik. 25
7569