Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
130 Zobrazení

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
Zrušit
Autor

Thank you very much. It works

Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
zář 25
167
2
zář 25
275
1
srp 25
350
0
srp 25
1034
0
čvc 25
354