Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Unable to hide fields

By
Frankie Chan
on 7/7/14, 10:11 PM 628 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>

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

Thanks for your solution.

Frankie Chan
on 7/8/14, 2:18 AM
1

Jagdish Panchal

--Jagdish Panchal--
2674
| 5 3 6
Gandhinagar, India
--Jagdish Panchal--

OpenERP Developer

Jagdish Panchal
On 7/7/14, 11:36 PM

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>

0
MUHAMMED HASHIR MK
On 7/8/14, 12:17 AM

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"

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/7/14, 10:11 PM
Seen: 628 times
Last updated: 3/16/15, 8:10 AM