Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
121 Weergaven

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
Annuleer
Auteur

Thank you very much. It works

Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
sep. 25
161
2
sep. 25
275
1
aug. 25
349
0
aug. 25
1033
0
jul. 25
354