Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

ODOO9: Inherit class with a new view

By
Drees Far
on 4/18/16, 5:23 AM 257 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.

0

Jignesh Mehta

--Jignesh Mehta--
2087
| 6 4 8
Surat, India
--Jignesh Mehta--


Jignesh Mehta
On 4/18/16, 6:15 AM

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,


Thanks for the answer but it doesnt work unfortunately

Drees Far
on 4/18/16, 12:06 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/18/16, 5:23 AM
Seen: 257 times
Last updated: 4/18/16, 6:15 AM