Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
12362 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Jun 25
176
2
Jun 25
263
0
Apr 25
745
Odoo icon change Diselesaikan
2
Jan 25
998
2
Des 24
1157