Odoo Help


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.


Inherit form of res.partner

on 4/3/15, 8:59 PM 889 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--
| 6 5 8
Gandhinagar, India
--Anil R. Kesariya--
ERP Consultant

Key Skill
Technical & Functional Expert
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.



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

1 follower(s)


Asked: 4/3/15, 8:59 PM
Seen: 889 times
Last updated: 4/22/15, 10:22 PM