Skip to content

Typing lost on filtered / grouped / filtered_domain #419

@andg-odoo

Description

@andg-odoo

Post OXP feature/bug request (Not 1.0 blocking):

Your setup
Version: main branch via cargo install --git
Operating System: Ubuntu 24.04
IDE and/or Integration tool (for example: Vscode - official extension): neovim lsp

Describe the bug

  • If a recordset is filtered (or filtered_domain), it will return always return a recordset of the model that was filtered even if empty, as such, the default typing of TypeVar | Any is incorrect as it should always be the same model as the original. This occurs for self.filtered(), self.field.filtered(), recordset.filtered(), and all filtered_domain calls as well

  • If possible this should also apply to grouped which will return the model as the value of the returned dictionary. A nice to have would be key typing based on if the string it is grouped by refers to a field in the model that way the dictionary would be typed as {field: model} but that sounds difficult.

To Reproduce
Steps to reproduce the behavior: grouped or filtered a recordset.

Expected behavior
Typing occurs on filtered / filtered_domain / grouped

Screenshots
Filtered typing:
Image

Image

Grouped typing:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions