Skip to Content
Menu
This question has been flagged
2 Replies
12344 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
0
Jun 25
154
2
Jun 25
239
0
Apr 25
720
2
Jan 25
982
2
Dec 24
1149