2014-03-24 36 views
0

我嘗試在我的自定義模塊中的產品鏈接後創建子菜單,但它並未出現..我嘗試在銷售菜單中創建子菜單時出錯openerp 7

在我的模塊中,安裝完成後,我在「創建的菜單」中看到我的菜單名稱。

我嘗試只用這個代碼在我看來:

<?xml version="1.0" encoding="utf-8"?> 
    <openerp> 
     <data> 
      <menuitem name="Gamme" id="menu_gamme" parent="base.menu_product"/> 
     </data> 
    </openerp> 

或與此代碼:

<?xml version="1.0" encoding="utf-8"?> 
    <openerp> 
     <data> 
      <menuitem name="Gamme" id="menu_gamme" parent="base.menu_product"/> 

      <record model="ir.actions.act_window" id="action_gamme"> 
       <field name="name">Gamme</field> 
       <field name="model">gamme</field> 
       <field name="view_type">tree</field> 
       <field name="view_mode">tree,form</field> 
      </record> 
     </data> 
    </openerp> 

但最新的我有這樣的錯誤:

ValueError: No such external ID currently defined in the system: ailailail.action_gamme 
+0

這是你的整個代碼? – user1576199

+0

是的,這只是測試子菜單 – MichelRobico

回答

1

嘗試這些更改您的代碼。 您需要在您的菜單標記中使用您的ir.actiona.act_windows記錄的標識中的操作值。它會自動從記錄中提到的字段名取的名字「的Gamme」,你不需要指定它

<?xml version="1.0" encoding="utf-8"?> 
    <openerp> 
     <data> 
      <record model="ir.actions.act_window" id="action_gamme"> 
       <field name="name">Gamme</field> 
       <field name="model">gamme</field> 
       <field name="view_type">tree</field> 
       <field name="view_mode">tree,form</field> 
      </record> 
      <menuitem action="action_gamme" id="menu_gamme" parent="base.menu_product"/> 
     </data> 
    </openerp> 

希望這有助於....