Skip to Content
Menu
This question has been flagged
4 Replies
12382 Views

could someone please explain what i've done wrong with this code as the field will not appear in odoo


<odoo>
<record id="view_res_partner_form_inherit" model="ir.ui.view">
<field name="name">DRS Company Custom Fields</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='lang']" position="after">
<field name="k_code" string="Supplier"/>
</xpath>
</field>
</record>
</odoo>


Avatar
Discard

Look odoo inheritance: https://goo.gl/4Zyc9d

Best Answer

Hello Leke,

Try with the following code, and don't forgot added your xml file on __manifest__.py/__openerp__.py
after restart the server please upgrade your custom module.

<record id="view_res_partner_form_inherit" model="ir.ui.view">
<field name="name">DRS Company Custom Fields</field>
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<field name="lang" position="after">
<field name="k_code" string="Supplier"/>
</field>
</field>
</record>
Avatar
Discard
Best Answer

make yourself sure that you register this file into the __manifest__.py file

and also check that the form of res_partner is not replaced at anywhere 

Avatar
Discard
Related Posts Replies Views Activity
0
Aug 21
2405
1
Sep 20
3136
2
Nov 24
171
2
Mar 23
1642
4
Dec 23
16620