Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
4098 Näkymät

With OpenERP Framework search method issue.

ids = claim_obj.search(self.cr, self.uid, [('extract(month from cover_date)', '=', month)], context=context)

why extract(month from cover_date) function not evaluated ?

OpenERP Stop to perform this !!!

Avatar
Hylkää
Paras vastaus

Zahin,

The domain section is evaluated at ORM and it will not parse any postgresql keywords. What it does it evaluating the OpenERP fields on the left.

I see that you might have misunderstood domain meaning. [('extract(month from cover_date)', '=', month)] is the wrong expression.

The real meaning of the clause(domain) is the first element is field of openerp model, second one is operator and the third one is value you want to operate on.

Hope this helps. Thanks.

Avatar
Hylkää
Tekijä

OpenERP Does not have smart feature on search. typical to perform complex feature. Where again we have to use traditional cr.execute....

Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
lokak. 23
1625
0
lokak. 21
1837
0
elok. 15
3014
3
kesäk. 15
7963
1
maalisk. 15
5430