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

Hello Guys!!!

I want to inherit the class hr.employee.

I have made this in the python file.

And in the xml i have tried this:

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

<field name="name">test.employee.action</field>

<field name="res_model">hr.employee</field>

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

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

<field name="view_id" ref="view_test_employee_form"/>

</record>

But, the problem is that i got the view in the form view.

How can i correct this please.

Avatar
Discard
Best Answer

Hello Dress Far,


Try Below Code.

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

    <field name="name">test.employee.action</field>

    <field name="res_model">hr.employee</field>

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

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

</record>


<record model="ir.actions.act_window.view" id="test_employee_action_form">

    <field name="act_window_id" ref="test_employee_action" />

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

    <field name="sequence">1</field>

    <field name="view_id" ref="view_test_employee_form" />

</record>


Hope it works for you.

Thanks,


Avatar
Discard
Author

Thanks for the answer but it doesnt work unfortunately