1
votes

Every time when I click on My module menu it jump to new form instead of showing existing, I assigned access rule to my module and disable create and edit but still didn't work, what I want is when I click on my module menu it should open an existing form or I can use domain like user_id field = user.name.

This is my code.

     <record id="action_ru_students" model="ir.actions.act_window">
        <field name="name">Students</field>
        <field name="res_model">ru.students</field>
        <field name="view_id" ref="students_form_view"/>
        <field name="view_mode">form,kanban,tree</field>
    </record>

I tried to use domain on action e.g. = [("user_id","=",user.name)] user_id is a field linked to res.user but get error user.name not found. also used create="false" and edit="false" on form still no luck.

Any ideas how to do it?

1

1 Answers

1
votes

Use sequence Tree,kanban,form in view_mode

<record id="action_ru_students" model="ir.actions.act_window">
    <field name="name">Students</field>
    <field name="res_model">ru.students</field>
    <field name="view_id" ref="students_form_view"/>
    <field name="view_mode">tree,kanban,form</field>
</record>

It might be helpful to you!