İçereği Atla
Menü
Bu soru işaretlendi
7 Cevaplar
37601 Görünümler

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>

</xpath>


Thanks in advance,,,,

Avatar
Vazgeç

Which view did you override with this change?

En İyi Yanıt

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}"
groups="base.group_user"
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)"/>
</xpath>
  </field>
</record>
Avatar
Vazgeç
Üretici

thanks!

En İyi Yanıt

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

Avatar
Vazgeç
En İyi Yanıt

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/>

</xpath>

 

Avatar
Vazgeç
Üretici

not working..!

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

İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Ağu 23
3244
0
Kas 21
2331
4
Eki 21
79975
0
Nis 21
5417
1
Ara 19
3686