Hi,
Here we can add a compute function to the 'is_customer_approve_online' boolean field based on your mentioned condition. Then we can add the field in filters by inheriting the sale.order search view.
.py
is_customer_approve_online = fields.Boolean(
string="Is Customer Approve Online",
compute='_compute_is_customer_approve_online',
store=True
)
@api.depends('workorder_ids.checklist_is_customer_approve_online', 'http://workorder_ids.name" rel="noopener nofollow noreferrer" target="_blank">workorder_ids.name')
def _compute_is_customer_approve_online(self):
for order in self:
for workorder in order.workorder_ids:
if workorder.checklist_is_customer_approve_online and http://workorder.name" rel="noopener nofollow noreferrer" target="_blank">workorder.name != 'Proofing':
order.is_customer_approve_online = True
else:
order.is_customer_approve_online = False
break
.XML
<record id="view_sale_order_tree_custom" model="ir.ui.view">
<field name="name">sale.order.tree.custom</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_sales_order_filter"/>
<field name="arch" type="xml">
<filter name="my_sale_orders_filter" position="after">
<separator/>
<filter name="is_customer_approve_online_filter"
string="Customer Approve Online"
domain="[('is_customer_approve_online', '=', True)]"/>
</filter>
</field>
</record>
Hope it helps