Help

0

context for partner_id not filtering

Avatar
Asis

Trying to get list of customers only on dropdown with a many2one relationship, habve this on the xml:

 <record model="ir.ui.view" id="libro_form_view">
        <field name="name">libro.form</field>
        <field name="model">produccion.libro</field>
        <field name="arch" type="xml">
            <form string="Libro Form">
                <sheet>
                    <group>
                        <field name="partner_id" widget="res_partner_many2one" context="{'res_partner_search_mode': 'customer'}"/>
                        <field name="num_desde"/>
                        <field name="num_hasta"/>
                        <field name="letra"/>
                        <field name="activo"/>
                    </group>
                </sheet>
            </form>
        </field>
    </record>
however, i still get list of all contacts. What ma i missing?


Workingon Odoo13

Avatar
Discard
2 Answers
1
Avatar
Chris TRINGHAM
Best Answer

This is true in standard Odoo (v13).  You can select any type of contact for a Sales Order!

Maybe you can try adding a domain:

domain="[('customer_rank', '>', 0)]"
Avatar
Discard
0
Avatar
Asis
Best Answer

Works perfectly! Thank you!


Avatar
Discard