Field Service


What is the difference between "filter_domain" and "domain" filter attributes?

JC Paniagua

In the module of the core 'sale' (sale_views) we can find the line:

<field name="order_line" string="Product" filter_domain="[('order_line.product_id', 'ilike', self)]"/>

When the filter is tested for 'cer' by Product, 60 sales orders appear, but if you export this data, 200 appear on the csv (e.g.).

The results of this csv are correct. Different sales orders also contain 'cert'.

According to the difference between filter_domain and domain is that in filter_domain you can use 'self'.

But by changing in the field 'filter_domain' to 'domain' the filter works:

<record id="view_sales_order_filter_fixed" model="ir.ui.view">

        <field name="name">view.sales.order.filter.fixed</field>

        <field name="model">sale.order</field>

        <field name="inherit_id" ref="sale.view_sales_order_filter"/>

        <field name="arch" type="xml">

            <field name="order_line" position="replace">

                <field name="order_line" string="Product" domain="[('order_line.product_id', 'ilike', self)]"/>




Why does this happen? Can you use 'self' with 'domain' or is it a sales module error?