Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
160 Visualizzazioni

My code in Odoo 18 is:

...

<record id="action_packing_order" model="ir.actions.act_window">

        <field name="name">Packing tasks</field>

        <field name="res_model">packing.order</field>

        <field name="view_mode">list,form</field>

    </record>

...

<menuitem

        id="menu_packing_order"

        name="Packing"

        action="action_packing_order"

        parent="stock.menu_stock_root"/>

It installs correctly but I can't find my menu item in stock app.



Avatar
Abbandona
Autore

Thank you very much. It works

Risposta migliore

Your menu item is most probably there already. You could verify its existence in Settings -> Technical --> User Interface -> Menu Items to ensure your data-key in your __manifest__.py-file is correct and your module is correctly installed/updated.

If this is the case, you are most likely missing the permission to actually see (read) from the packing.order model - thus you can't access its action(s) either. Ensure you have either a security.xml or ir.model.access.csv added to the data-key of your __manifest__.py-file as well (the file names are not fixed but reflect best practices).

security.xml could look like this:

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="access_packing_order" model="ir.model.access">
<field name="name">access.packing.order</field>
<field name="model_id" ref="model_packing_order"/>
<field name="group_id" ref="base.group_user"/>
<field name="perm_read" eval="1"/>
<field name="perm_write" eval="1"/>
<field name="perm_create" eval="1"/>
<field name="perm_unlink" eval="1"/>
</record>
</odoo>

Alternatively, your ir.model.access.csv could look like this:

"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
access_packing_order,access_packing_order,model_packing_order,base.group_user,1,1,1,1


You could do this manually via UI as well, however, with a model created in a custom module, I would not suggest to do so in the beginning: https://www.odoo.com/documentation/18.0/applications/general/users/access_rights.html

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
set 25
208
2
set 25
296
1
ago 25
362
0
ago 25
1044
0
lug 25
354