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

creating a new model from an existing one, adding new information to the copy but leaving the original module as-is

By
Drees Far
on 8/3/15, 7:38 AM 272 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.


0
Virali
On 8/3/15, 8:07 AM

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.

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: 8/3/15, 7:38 AM
Seen: 272 times
Last updated: 8/3/15, 8:07 AM