2014-06-19 3 views
1

나는 이것을 묻는 방법을 모르지만, 사용자가 "Accounting"> "Suppliers"> "Purchase Receipts"로 간다고 가정하면, 바로 그 페이지에서만 무언가를 할 필요가 있습니다. 내가 그 페이지에 있다는 것을 어떻게 알 수 있습니까? 내 솔루션은 인스턴스에서 변수를 얻는 것입니다 그러나 나는 어떤 행운을 얻고 있지 않습니까? 아니면 내가 잘못된 길을보고 있습니까?openERP 7 : 현재 페이지의 모델 이름 및 동작을 얻는 방법?

내 코드 : 애드온/account_voucher /에서

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); 
    } 
}); 

코드 : 당신의 방법에서

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

답변

-1

은 모델 이름을 가져 self._name를 호출합니다.