This question has been flagged
1 Reply
5248 Views

I have a buton in a view that call a javascript function and want to open the invoice view filtered on the current partner. I have the following code :

open_invoices: function() {
            this.do_action({
                views: [[false, 'tree']],
                view_type: 'form',
                view_mode: 'tree,form',
                res_model: 'account.invoice',
                type: 'ir.actions.act_window',
                target: 'current',
                context: {'search_default_partner_id': partner_id}
            });
        }

However, this opens all the invoices (the filter is not done) and the view looks weird, it's not a normal tree view. It also takes a lot of time to load the view... do you see any mistakes ?

Avatar
Discard
Best Answer

Hello Emanuel, did you solve this problem? I have the same issue on v8

Avatar
Discard
Author

Hello, sorry but I think I made something else because I never got the solution.

Thanks! Issue [V8] [Solved] , change views: [[false, 'tree']] to views: [[false, 'list']],

open_invoices: function() {

this.do_action({

views: [[false, 'list']],

view_type: 'form',

view_mode: 'tree,form',

res_model: 'account.invoice',

type: 'ir.actions.act_window',

target: 'current',

context: {'search_default_partner_id': partner_id}

});

}