I want to update the existing Sales Order Line tree view that is embedded in the default Odoo 9 Sales Order form view to hide a row based on a condition of the sales order line.
View being modified: sale.view_order_form
<notebook>
<page string="Order Lines">
<field name="order_line" mode="tree,kanban" attrs="{'readonly': [('state', 'in', ('done','cancel'))]}">
...
<tree string="Sales Order Lines" editable="bottom" decoration-info="invoice_status=='to invoice'">
<field name="sequence" widget="handle"/>
<field name="product_id"/>
<field name="name"/>
...
<field name="is_delivery" invisible="1"/>
...
Generally, there is only one item which "is_delivery", so I still want to see the rest of the items for the order.
I have tried using domain and attrs but so far I haven't had any success whatsoever. I think it is because the view is using the sale.order model, but the embedded tree view is using records from sale.order.line?
How can I hide the line item if "is_delivery" is True?
have you found a way to do so?