Odoo Help


Make invisible a field in existing view?

on 1/4/16, 2:21 PM 1,571 views

Hello all,

I want hide a field in existing view at sale order form view.

Here i tried is

<xpath expr="//field[@name='order_line']/form/group/group/field[@name='product_id']" position="attributes">

<attribute name="attrs">{'invisible': 1}</attribute>


Thanks in advance,,,,

Which view did you override with this change?

Bista Solutions US, Ray Carnes
on 1/4/16, 4:35 PM
On 1/11/16, 4:20 AM

use the below code...............................

<record id="sale_order_form_b2b" model="ir.ui.view">
<field name="name">sale.order.form.b2b</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale_stock.view_order_form_inherit" />
<field name="priority">4</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='order_line']/form//field[@name='product_id']" position="replace">
<field name="product_id" invisible="1"
context="{'partner_id':parent.partner_id, 'quantity':product_uom_qty, 'pricelist':parent.pricelist_id, 'uom':False, 'company_id': parent.company_id}"
on_change="product_id_change_with_wh(parent.pricelist_id,product_id,product_uom_qty,False,product_uos_qty,False,name,parent.partner_id, False, True, parent.date_order, product_packaging, parent.fiscal_position, False, parent.warehouse_id, context)"/>


on 1/11/16, 4:26 AM

You have to provide full path of the field you need to hide, try something like the following

<xpath expr="/form/sheet/notebook//page[@string='Products']//field[@name='order_line']/tree//field[@name='product_id']" position="attributes">

    <attribute name="invisible">1</attribute/>



not working..!

on 1/6/16, 5:10 AM

so, pls give us more information. We need, as Ray pointed out: Which view did you override with this change?

Tarek Mohamed Ibrahim
on 1/6/16, 7:43 AM
Dr Obx
On 1/11/16, 6:18 AM

If any of the methods suggested by Tarek or Ray won't work just go to the "Settings/Technical/User Interface/Views"

then search for 'sale.order.form'
click edit and add invisible="1" to the field you want to hide, save and done :)

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/4/16, 2:21 PM
Seen: 1571 times
Last updated: 1/11/16, 6:19 AM