Reputation: 107
I am trying make invisible field Quotation Date which field is date_order in sales odoo13 community.
quotation_product.xml
<xpath expr="/form/sheet/group/group/field[@name='date_order']" position="attributes">
<attribute name="invisible" attrs="{'invisible': [('state', 'in',['sale', 'done', 'cancel'])]}" >1</attribute>
</xpath>
using above code field is invisible but field name Quotation Date is showing in quotataion state, I am also trying to make invisible Order Date which field is date_order in sales order state,this will shows After clicking confirm button in sales.
Upvotes: 1
Views: 635
Reputation: 11143
Try with following code, It will hide permanently Odoo base field.
<xpath expr="/form/sheet/group/group/field[@name='date_order']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
If you want to hide field base on condition, use following style.
<xpath expr="/form/sheet/group/group/field[@name='date_order']" position="attributes">
<attribute name="attrs">{'invisible': [('state', 'in', ['sale', 'done', 'cancel'])]}</attribute>
<!--attribute name="attrs">{'invisible': [('field_name', 'operator', condition)]}</attribute-->
</xpath>
NOTE: Use invisible
attribute name for hide permanently and attrs
for condition based visibility
Upvotes: 3