← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 681497] [NEW] Search view fails on m2o with domain

 

Public bug reported:

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(?)

** Affects: openobject-server
     Importance: Undecided
         Status: New

-- 
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: New

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(?)





Follow ups

References