Odoo Help


2 Answers



| 6 5 8
11‏/7‏/2013 6:44 م

Why don't you modify existing res.partner class adding new checkbox 'dealer' instead of creating new model? Here is a good explanation of xml inheritance.


Grover Hernando Menacho Quisbert

--Grover Hernando Menacho Quisbert--
WebVision Enterprise Systems
| 7 8 10
La Paz, بوليفيا
--Grover Hernando Menacho Quisbert--

Odoo Developer

Grover Hernando Menacho Quisbert
11‏/7‏/2013 8:13 م

Let me explain you something.

As I see your code you are creating a new object inheriting the res.partner. What you are doing is that you are creating a new class with new record with ANY relation with res.partner.

If you want to create a new place to see the dealers just add a new field on your class.

Like is a company. Is it a dealer?

Then you can create another menu calling the same res_partner_view but with domain filtering only dealers.

Praveen S
12‏/7‏/2013 5:01 ص

hello Grover i need to add some additional info in the dealer table. so i wish to store all the contact info in partner table and other info in dealer table. how it is possible? its similar to res_user but i didn't understand its view structure.

GH Mediacloud, Grover Hernando Menacho Quisbert
12‏/7‏/2013 12:17 م

There are many ways to do it.

GH Mediacloud, Grover Hernando Menacho Quisbert
12‏/7‏/2013 12:20 م

First you can create new fields on the same res.partner. Inherit but without a new name. You can create a new boolean field as i told you "Is it a dealer?" and other additional fields. Then you can add a new tab page below with attrs invisible when is_it_dealer=False. So if it's a dealer then it's going to have additional info

GH Mediacloud, Grover Hernando Menacho Quisbert
12‏/7‏/2013 12:21 م

Another way is creating a new module dealer. But with a many2one field with res.partner. So you can associate a partner to your new module dealer. The new module doesn't need an inheritance of re.partner. You just need a many2one field that links them.

Praveen S
13‏/7‏/2013 1:45 ص

Grover my problem is how to use that existing view. Many2one is not suitable for me. i need to use all fields in res_partner. i can't create views for inherited fields. how its possible?

GH Mediacloud, Grover Hernando Menacho Quisbert
13‏/7‏/2013 2:47 م

Well. Maybe if you can give more details about your new view. As I understood is that you are creating a new partner but with more data as a dealer. If that's the case you only have to inherit res.partner and add dealer fields. It's not going to affect the other partners. As I told you you can add a boolean field to check if it's dealer. and depending that field dealer fields are going to be available. That's the way that I see a solution for this. Well that's what I understood.

Ask a Question
Keep Informed
0 follower(s)
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.

Odoo Training Center

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

Test it now