Thursday, 15 May 2014

javascript - openERP 7: How to get the Model name and Action of the Current page? -



javascript - openERP 7: How to get the Model name and Action of the Current page? -

i don't how inquire this, assuming user goes "accounting" > "suppliers" > "purchase receipts", need @ page. how know @ page? solution variable instance i'm not getting luck or looking @ wrong way?

my code:

instance.web.viewmanageraction = instance.web.viewmanageraction.extend({ switch_mode: function(view_type, no_store, view_options){ // testing, output console results similar console.log( "account.voucher" + "action='action_purchase_receipt'" ); // other code homecoming this._super(view_type, no_store, view_options); } });

code /addons/account_voucher:

<menuitem id="menu_action_purchase_receipt" icon="stock_justify_fill" action="action_purchase_receipt" parent="account.menu_finance_payables" sequence="10" />

in method phone call self._name model name.

javascript openerp web-frameworks openerp-7

No comments:

Post a Comment