Odoo Help


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.


Inerit module

jignasha royala
on 3/17/16, 3:19 AM 266 views

how to inherit product.product in my costume module in model,py file in 

can you tell me how to store demo data in demo.xml file in using my costume model class  

On Thu, Mar 17, 2016 at 1:45 PM, Jignesh Mehta <mj.jignesh@gmail.com> wrote:

A new answer on Inerit module has been posted. Click here to access the post :

See post

Sent by Odoo S.A. using Odoo

jignasha royala
on 3/17/16, 5:51 AM

See my updated code. Thanks,

Jignesh Mehta
on 3/17/16, 8:04 AM

On Thu, Mar 17, 2016 at 5:34 PM, Jignesh Mehta <mj.jignesh@gmail.com> wrote:

See my updated code. Thanks,

Sent by Odoo S.A. using Odoo

jignasha royala
on 3/21/16, 2:19 AM

Jignesh Mehta

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

Jignesh Mehta
On 3/17/16, 4:15 AM

Hello Jignasha,

In py :-

 class ProductProduct(models.Model): 
    _inherit = 'product.product'

    custom_field = fields.Char('Your Field Name',size=50,select=True)

In Xml:-

<record model="ir.ui.view" id="view_product_product_form">
    <field name="name">product.product.form</field>
    <field name="model">product.product</field>
    <field name="inherit_id" ref="product.product_normal_form_view"/>
    <field name="type">form</field>
    <field name="arch" type="xml">
        <field name="name" position="after">
            <field name="custom_field"/>

demo.xml :-

<?xml version="1.0" encoding="utf-8"?>


<data noupdate="0">

    <record id="hr_department_department_name" model="hr.department">

        <field name="name">Department Name</field>




From this, In Department Name record is created in the department menu.

Hope it works for you.



jignasha royala
on 3/17/16, 4:47 AM

this demo.xml is for product.product ?

jignasha royala
on 3/17/16, 8:07 AM

nope. this is for department. but you can create demo file same as above code. In code, model="product.product" and field which you want for product.

Jignesh Mehta
on 3/17/16, 8:16 AM

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

2 follower(s)


Asked: 3/17/16, 3:19 AM
Seen: 266 times
Last updated: 3/21/16, 2:21 AM