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 ?