İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
4046 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Mar 25
1217
0
Oca 25
3274
1
Ağu 23
14575
change password Çözüldü
1
Ağu 23
13234
1
Tem 23
10237