Hide a field using Selection odoo

.py selection field.

class sale_order(osv.osv):
    _columns ={

.xml file

<record id="ep_sale_view_order_form" model="ir.ui.view">
   <field name="name">Sale</field>
   <field name="model">sale.order</field>
   <field name="inherit_id" ref="sale.view_order_form"/>
   <field name="arch" type="xml">
              <xpath expr="//field[@name='partner_id']" position="before">
                  <field name="resource_selection" string="Resource"/>

              <field name="partner_id"  position="replace">
                  <field name="partner_id" attrs="{'invisible':[('resource_selection','=','lead')]}" />

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s