Cris Tuan
Cris Tuan

Reputation: 43

Why does a Many2one field ignore its domain in custom filters in Odoo 17?

sku_shipping_id = fields.Many2one(
    "product.product", 
    string='SKU Shipping', 
    domain="[('sku_type_ids.code', 'in', ['ship'])]"
)

On the view, when I click to select a value for this field, the domain works correctly, and only records with sku_type_ids.code = 'ship' are shown.

However, when I use the Add Custom Filters feature, select this field, and try to filter the records, it shows all records without applying the domain.

I need a solution to ensure the domain is respected when using custom filters for this Many2one field. enter image description here

Any help would be appreciated!

Upvotes: 0

Views: 42

Answers (0)

Related Questions