Skip to Content
Menu
This question has been flagged
5 Replies
2391 Views

I tried this following code to add new fileds in the res partner form view that I have already inherited in a new module  but nothing showed up after updating with no errors and no effects menchening that i want to add those fileds when cheking the company type button radio not tye person one because in the main code there are some fileds that are invsible depending on this radio button company type.so what could be wrong in this code not showing any changes in my new model

<?xml version="1.0" encoding="utf-8"?>

<openerp>

<data>

<record id="view_partner_form_inherit" model="ir.ui.view">

<field name="name">res.partner.form.inherit</field>

<field name="model">res.partner</field>

<field name="inherit_id" ref="base.view_partner_form"/>

<field name="arch" type="xml">

<xpath expr="//field[@name='website']" position="after">

<field name="rs_ctr"/>

<field name="nb_ligne"/>

</xpath>

</record>

</data>

</openerp>

Avatar
Discard

which version of odoo you use ?

had you put this view file in __openerp__.py ?

Author

yes I have put it in __openerp__.py I'm using odoo9

Best Answer

Hello Amina, 

change following in your code. I hope it's work.


<field name="arch" type="xml">

<xpath expr="//field[@name='website']" position="after">

<field name="rs_ctr"/>

<field name="nb_ligne"/>

</xpath>

            </field>


Avatar
Discard
Author Best Answer

well it worked now after adding a missing /> in my code but those fields are showing in 2 selections button radio (individual/company) so I want to show them only on checking the copmany radio button please any ideas??how may I do that?

Avatar
Discard

yes u can .. like using attrs condition in your field