跳至内容
菜单
此问题已终结
4 回复
13809 查看

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>


形象
丢弃

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

最佳答案

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>
形象
丢弃
最佳答案

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 

形象
丢弃
相关帖文 回复 查看 活动
0
8月 21
3183
1
9月 20
3936
2
11月 24
1644
2
3月 23
3223
4
12月 23
17923