跳至內容
選單
此問題已被標幟
1 回覆
4558 瀏覽次數

Hello i want to add new menus and submenus under Invoicing.
I know i need an action for my menu and a view. I'm using Odoo11

This what i've got so far.

    <!-- menu categories -->
    <menuitem name="Localizaciones" id="localizaciones_menu_1" parent="menu_finance_receivables" sequence="6"/>
    <!-- sub-menu categories -->    
<menuitem name="Enviadas" id="localizaciones_submenu_1" parent="localizaciones_menu_1" sequence="1" action="x_nc_act_inv_fac_env"/>
<menuitem name="Pendientes" id="localizaciones_submenu_2" parent="localizaciones_menu_1" sequence="2" action="x_nc_act_inv_fac_pen"/>

            But i get the error

  File "/usr/lib/python3/dist-packages/odoo/addons/base/ir/ir_model.py", line 1318, in xmlid_lookup
    raise ValueError('External ID not found in the system: %s' % xmlid)
odoo.tools.convert.ParseError: "External ID not found in the system: mymodule.menu_finance_receivables" while parsing /usr/lib/python3/dist-packages/odoo/addons/mymodule/views/views.xml:292, near
<menuitem name="Localizaciones" id="localizaciones_menu_1" parent="menu_finance_receivables" sequence="6"/>

So i though the problem might be the inheritance from my module. But i already inherited account.invoice on my models.py and set my dependence like:

    'depends': ['base','account','sale'],

I don't know what am I missing. Thanks in advance.


頭像
捨棄
最佳答案

Hi,

The problem is with the parent ID  you have given. Hope the parent id you given is the menu which is already under the invoicing menu.


The external ID for the corresponding menu will be like account.menu_finance_receivables something like this.


To get it exactly activate the developer mode and navigate to Settings -> Technical ->  User interface -> Menu items and search the parent menu name here. Open the menu and click on the lady debugger button near the logged in users name, the from the listing click on the view metadata from here you will get the external ID of corresponding menu, copy it and paste it in the code.


 See the video to see how to get the external ID of a menu: https://youtu.be/rK5Qe8mA89Q


Thanks

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
9月 22
668
2
10月 20
3982
3
2月 21
28314
2
12月 19
2683
2
8月 18
3250