1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] ODOO: Passing by default two filters in context using the AND operator

Discussão em 'Python' iniciado por Stack, Outubro 4, 2024 às 05:32.

  1. Stack

    Stack Membro Participativo

    In the following action I am sending two filters and a grouping, the filters are search_default_projects_activities and search_default_active_poa, however, these filters are applied with the OR operator as can be seen in Image 1, I know I can configure in the GUI the condition (see Image 2) but I need that by default, or rather, by code it is indicated that the operator must be an AND. Any idea? Thanks in advance.

    <record id="action_uc_planning_poa_dependency_project" model="ir.actions.act_window">
    <field name="name">Proyectos</field>
    <field name="type">ir.actions.act_window</field>
    <field name="res_model">uc_planning.poa_dependency_project</field>
    <field name="view_mode">tree,form</field>
    <field name="domain">[]</field>
    <field name="context">
    {
    'search_default_poa_dependency_id': 1,
    'search_default_active_poa':1,
    'search_default_projects_activities': 1
    }
    </field>
    </record>


    Image 1

    Filters with OR operator

    Image 2

    AND Operator

    I tried to pass the two filters with an AND operator to the context by code, but I only achieved it by using the Odoo GUI. I need to set the filters with the AND operator using the views (XML) code.

    Continue reading...

Compartilhe esta Página