← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 681497] Re: Search view fails on m2o with domain

 

Did you try using the 'Bug Category' search in 'Search View Bug Demo'?

Its results should show bug categories matching the search string and limited by the domain [('some_number','in',[3,4,5])].
Instead it throws an error implying that it is looking for 'some_number' in search_view_bug_demo.

-- 
Search view fails on m2o with domain
https://bugs.launchpad.net/bugs/681497
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.

Status in OpenObject Server: Invalid

Bug description:
I have a model, grove, with a many2one to res.partner like so:

    'grower': fields.many2one('res.partner', 'Grower', domain="[('category_id','=','Grower')]", required=True, select=True),

This is all good. However, the following search view field on the many2one fails with this error:

    db.cursor:Programming error: column citrus_grove.category_id does not exist

Indeed it doesn't since category_id is in res.partner.

<record id="view_citrus_grove_filter" model="ir.ui.view">
    <field name="name">citrus.grove.select</field>
    <field name="model">citrus.grove</field>
    <field name="type">search</field>
    <field name="arch" type="xml">
        <search string="Search Groves">
            <group col='10' colspan='4'>
                <field name="grove_name" select="1"/>
                <field name="grower" select="1"/>
            </group>
        </search>
    </field>
</record>

Searching on the grove_name works fine.

I attach a small module (not the one above) which demonstrates the problem, although the error message is different(?)





References