Skip to Content
Menu
This question has been flagged
1 Reply
3485 Views

I have a custom app. In my model I have a Many2One form the type res.partner.

If I display the field in a form view, I get the name, address, city and country.

How can I hind the address and display only the name?


Avatar
Discard
Best Answer

For Odoov10 You inherit res.partner. From that file you can invisible these fields from XML code;

Here is the procedure to inherit that file and invisible address.

<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="custom_info_order_form">
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="name">Customer information Form</field>
<field name="model">res.partner</field>
<field name="arch" type="xml">
<data>
<xpath expr="//form//sheet//group//group//div//field[@name='street']" position="replace">
<field name="street" required="1" placeholder="Street1"/>
</xpath>

<xpath expr="//form//sheet//group//group//div//field[@name='city']" position="replace">
<field name="city" invisible="1"/>
</xpath>
<xpath expr="//form//sheet//group//group//div//field[@name='state_id']" position="replace">
<field name="state_id" invisible="1"/>
</xpath>
<xpath expr="//form//sheet//group//group//div//field[@name='country_id']" position="replace">
<field name="country" invisible="1"/>
</xpath>

<xpath expr="/form/sheet/group/group/div/field[@name='zip']" position="replace">
<field name="zip" invisible="1"/>
</xpath>

</data>
</field>
</record>
</data>
</openerp>
Avatar
Discard