Skip to Content
Menú
This question has been flagged
4 Respostes
13882 Vistes

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
Descartar

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
Descartar
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
Descartar
Related Posts Respostes Vistes Activitat
0
d’ag. 21
3239
1
de set. 20
3982
2
de nov. 24
1736
2
de març 23
3324
4
de des. 23
18005