Odoo Help


How to hide a Sale Order Line based on "is_delivery"?

Travis Waelbroeck
on 7/30/16, 7:44 PM 1,324 views

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


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

--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 7/31/16, 2:05 AM


Just as a suggestion: try to add a new field to sale.order.line which is 'active', the active field toggle the global visibility of the record as in the documentation , and you can do some changes that when the order line set to is_delivery toTrue then set the active to False

hope this could helps

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: 7/30/16, 7:44 PM
Seen: 1324 times
Last updated: 7/31/16, 2:05 AM