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.

1

Can i completely inherit all the fields & button of one module in to another module?

By
Remya
on 9/20/13, 7:14 AM 549 views

I want to inherit complete model into another model. How can inherit?

I have to models. Model1, Model2

In Model1 there are many fields & buttons present. Can i call all the fields & buttons in Model2?

In Model2 also have its own fields.

Why not just copy and past the second module in the first one if you just need the functions inside one module alternatively you can use the relation function. So anything in one module will also go to the appropriate field in the other. You can see how address works with Partner for example.

kaynis
on 9/20/13, 8:42 AM

Or else you can inherit both themodel and your view as per your requirements, so that suppose if you wish to add some fields along with the old fields only after inheritance is possible. Thank you!

Abhishek H Menon
on 9/20/13, 9:00 AM

I just want to add the whole model in my second model. So how can i add, python code & xml code.

Remya
on 9/20/13, 9:54 AM

What you can do is copy the first python file into the folder of the second module and then add copy the xml code of the first into the code of the second but you will have to change model name to the second or you can simply insert the ids of the models from first module inbetween those of the second. then add the first into the __init__ code of the second module as well i.e import first_module. You will need to be careful that no module depends on the first xml for display. If they are both your custom modules that are only associated with each other you should have no problem

kaynis
on 9/20/13, 10:42 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

0 follower(s)

Stats

Asked: 9/20/13, 7:14 AM
Seen: 549 times
Last updated: 3/16/15, 8:10 AM