Skip to Content
Menu
This question has been flagged
1 Reply
7042 Views

Hello Guys !!

Can anyone help to know how to create the action of a menu that opens form view not tree and in the read mode which means of the first record.

I have tried this :

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

                <field name="name">Test</field>

                <field name="type">ir.actions.act_window</field>

                <field name="res_model">test.test</field>

                <field name="view_type">form</field>

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

                <field name="help" type="html">

                        <p class="o_view_nocontent_smiling_face">

                        Create a Test!

                        </p>

            </field>

        </record>

This code let me open in the form view but to create a new record.

I want it to open an existing record (the first one as an example)

Thanks a lot in advance.

Best regards.

Avatar
Discard
Author Best Answer

I have found the solution to my problem.

In the documentaion of ODOO:

res_id (optional)
if the default view is form, specifies the record to load (otherwise a new record should be created)

So the solution is to add the res_id of a specific record so that the create mode is visible.

Thanks a lot.

Best regards.

Avatar
Discard
Related Posts Replies Views Activity
1
Nov 24
166
1
Sep 21
8137
1
Jan 21
3039
1
Jan 24
15729
4
Apr 16
5374