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

Discussão em 'Python' iniciado por Stack, Janeiro 17, 2025.

  1. Stack

    Stack Membro Participativo

    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. [​IMG]

    Any help would be appreciated!

    Continue reading...

Compartilhe esta Página