This question has been flagged
1 Reply
3199 Views

Hello guys!!

Please, i work with the inheritance procedure.

I want to create a new model from an existing one, add new information to the copy but leaving the original module as-is.

So i use in my python:

_name = New

_inherit = obj1, ...

The problem is that i dont know what to put in my XML.

Here is my example:


<record id="view_hr_form_inherit" model="ir.ui.view">

<field name="name">hr.hr.employee.form.inherit</field>

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

<field name="inherit_id" ref="hr.view_employee_form"/>

<field name="arch" type="xml">

Who can help please.

Thanks and Regards.


Avatar
Discard
Best Answer

Firstly if you inherit and give _name attribute with some different name then in your XML you need not to inherit view by giving inherit id.

You need to simply create view but in this you can access all field of inherit view.


<record id="view_hr_form" model="ir.ui.view">

<field name="name">new model name</field>

<field name="model">model name<field>

 <field name="arch" type="xml">

      <field name=field name"/>

</field>

</field>

</record>

Hope this will help you.

Avatar
Discard