Odoo Help

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 618 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

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

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