Skip to Content
Menu
This question has been flagged
2 Replies
11263 Views

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"
                />

Avatar
Discard
Best Answer

You need to Turn on Develope Mode by following

1. Look at the top right of application (Administration), click on it, then you will see About OpenERP. Then click on it. It will show you the wizard in the middle of the page. Then click on Active the Develop Mode.

2 Go to Accounting" > "Suppliers" > "Purchace Reciepts. You will see a small bar near the name "Purchase Reciepts" can be called as Debug Bar.

3. If you are working on Tree, just click Edit Tree View, then you will see the view (by xml_id) that you are working on 

Avatar
Discard
Best Answer

this.dataset.model is used get current model in openerp

instance.web.ViewManagerAction = instance.web.ViewManagerAction.extend({
    switch_mode: function(view_type, no_store, view_options){

        // To get Current Module Name
        console.log("Module Name" +this.dataset.model);

        // some other code

        return  this._super(view_type, no_store, view_options);
    }
});

Avatar
Discard
Related Posts Replies Views Activity
2
Dec 24
107
1
Nov 24
129
1
Mar 15
6964
0
Dec 24
35
1
Dec 24
66