This question has been flagged
2 Replies
2974 Views

Hello,

I would like to hide the "tax_id" fleld in note in Sales--->Quotations.

See LINK.

Can anyone  please help?

Thanks.

My code is

---------------------------------------------------------------------------------------------------------------------

<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>
        <record id="view_quotation_test_form" model="ir.ui.view">
            <field name="name">sale.order.form</field>
            <field name="model">sale.order</field>
       <field name="inherit_id" ref="sale.view_order_form" />
            <field name="arch" type="xml">

     <field name="tax_id" position="attributes">
                <attribute name="invisible">1</attribute>
            </field>

        </field>
    </record>

    
  </data>
</openerp>

---------------------------------------------------------------------------------------------------------------------

Avatar
Discard
Author

Thanks for your solution.

Best Answer

Hi

Try this code

<?xml version="1.0" encoding="utf-8"?>
<openerp>
  <data>
        <record id="view_quotation_test_form" model="ir.ui.view">
            <field name="name">sale.order.form</field>
            <field name="model">sale.order</field>
               <field name="inherit_id" ref="sale.view_order_form" />
            <field name="arch" type="xml">

             <xpath expr="/form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='tax_id']" name="tax_id" position="attributes">
                <attribute name="invisible">1</attribute>
            </xpath>

        </field>
    </record>

    
  </data>
</openerp>

Avatar
Discard
Best Answer

you can use...

 

1. States: <field name="example" states="pending" /> ---> This field "example" is shown only when the stage is in "pending" state otherwise the field is hidden

2. Attrs: <field name="example" attrs="{'invisible': [('state','!=','pending')]}" /> ---> State other than "pending" is invisible for the field "example"

Avatar
Discard