Odoo Help


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.


Make invisible a field in existing view?

on 1/4/16, 2:21 PM 760 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

Tarek Mohamed Ibrahim

--Tarek Mohamed Ibrahim--
| 5 3 7
Gîza, Egypt
--Tarek Mohamed Ibrahim--

I am an old VFP developer on ERP

I have moved to 2p since Nov-2014 and started developing with Python on Odoo.



Tarek Mohamed Ibrahim
On 1/4/16, 6:29 PM

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 :)

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)


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