Odoo Help


How can i Inherit the customer form to new module in ODOO 10 .

on 9/22/17, 1:15 AM 1,618 views

 I wanted to inherit the customer Address from and Models which are linked to the the customer form to the new module .



Anil R. Kesariya (Jupical Technologies)

--Anil R. Kesariya (Jupical Technologies)--
| 7 6 8
Rajkot, India
--Anil R. Kesariya (Jupical Technologies)--

Odoo Techno Functional Expert

* Engaged with odoo since May - 2012.

* Customise existing module or develop new module base on customer requirement.

* Played key developer role in many past and running projects.

* Expert in requirement gathering of business and transforming requirement into odoo platform.

* Major expertise in core modules, database, report development and theme development.

* Integration expert.

Linkedin  : https://in.linkedin.com/in/anil-kesariya-97b20a66

Anil R. Kesariya (Jupical Technologies)
On 9/22/17, 2:59 AM

Hi Shararth,

1. If you  want to have separate table in database for new customer then this would help you.

from odoo import fields, models, api
class ResPartner(models.Model)
_name = 'your.new.customer.model'
_inherit = 'res.partner'

#you can add some additional field if require, all the partner fields are now accessible to your model.

2. If you just want to fetch information in some existing field from existing partner record than you can go for the solution given by @Avinash. But make sure must be having browse record/record set of customer from which you want to pull the data.

If your question doesn't matches any above to case than please describe your question in more detail.

Happy Odooing...

Hope this will help you.



Palkesh Baraiya
On 9/22/17, 2:51 AM
Hello you can use below Code to Inherit the Base Customer Form. 
And by using xpath you can Add Replace field in Existing View.
Here is some xpath attribute like,


<record id="view_partner" model="ir.ui.view">
<field name="name">view_partner</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='existing_field_name']" position="as_per_your_requirement">
<!--Entry of Your New Field-->

Avinash Nk

--Avinash Nk--

| 4 3 6
Calicut, India
--Avinash Nk--


Avinash Nk
On 9/22/17, 2:46 AM

If you want to get the details of a Customer(Record), No need to inherit the model.

You can get the Record details by the following code 

customer_obj = self.env['res.partner']
customer_record = customer_obj.browse(Costomer Record ID)

customer_record is a RecordSet.

You can access any field in that record by

field_value = customer_record.FieldName

In your case: street = customer_record.street, city = customer_record.city etc

Thank you.

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

Question tools

1 follower(s)


Asked: 9/22/17, 1:15 AM
Seen: 1618 times
Last updated: 9/22/17, 5:32 AM