Odoo Help


Inherit form of res.partner

on 4/3/15, 8:59 PM 1,934 views

I create a new class fleet_agent that inherits from res.partner without problems

class fleet_agent(osv.Model): 
_name = 'fleet.agent' _inherit = ['res.partner'] _columns = { 'test': fields.char('Test', help='Test'),

then fleet_agent_form inherits base.view_partner_form also no problem

<record id="fleet_agent_form" model="ir.ui.view"> 
<field name="name">fleet.agent.form</field> <field name="model">fleet.agent</field> <field name="inherit_id" ref="base.view_partner_form" /> <field name="arch" type="xml"> <field name="state_id" position="before"> <field name="x" /> </field> </field>

My problem is that this form does not appear as the formatting of view_partner_form and with all fields without any order ?


Anil R. Kesariya

--Anil R. Kesariya--
| 7 6 8
Rajkot, India
--Anil R. Kesariya--

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
On 4/11/15, 7:11 AM

Hello mehdi,

These are the standard rules for inheriting view in odoo frameworks.

1) When you are inheriting any view you can only add those fields are added in the same model.

>> In your case you have created new model, it means your field should be inside the partner model. but you have your own model fleet.agent.

If you just want to add columns in partner view than you don't need to create your own model just inherit the existing one (res.partner) in py file and use the inheritance for res.partner model.

2) If you want to create your own model by inheriting the existing one model in that case create your own view with all fields those you want to display for your new model.

Suggestion: If you just want to append few fields on res.partner existing one view than follow like this.

Sample code :

    _inherit = 'res.partner'

    _columns = {

    your custom fields


    Now these fields will be able to append in the existing view ,which have already applied from your side.



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: 4/3/15, 8:59 PM
Seen: 1934 times
Last updated: 4/22/15, 10:22 PM