Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
156 Tampilan

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
Buang
Penulis

Thank you very much. It works

Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Sep 25
201
2
Sep 25
292
1
Agu 25
362
0
Agu 25
1043
0
Jul 25
354