跳至内容
菜单
此问题已终结
1 回复
4059 查看

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 !!!

形象
丢弃
最佳答案

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.

形象
丢弃
编写者

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

相关帖文 回复 查看 活动
2
10月 23
1571
0
10月 21
1784
0
8月 15
2965
3
6月 15
7914
1
3月 15
5408