I don't how to ask this, but assuming the user goes to "Accounting" > "Suppliers" > "Purchace Reciepts", now i need to do something only at that page. How do i know that i am at that page? Or i'm doing this the wrong way?
My code:
instance.web.ViewManagerAction = instance.web.ViewManagerAction.extend({
switch_mode: function(view_type, no_store, view_options){
// for Testing, output to console the results that are similar to this
console.log( "account.voucher" + "action='action_purchase_receipt'" );
// some other code
return this._super(view_type, no_store, view_options);
}
});
Code from /addons/account_voucher:
<menuitem
id="menu_action_purchase_receipt"
icon="STOCK_JUSTIFY_FILL"
action="action_purchase_receipt"
parent="account.menu_finance_payables"
sequence="10"
/>