Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4049 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
mar 25
1217
0
ene 25
3275
1
ago 23
14576
1
ago 23
13236
1
jul 23
10240