Odoo Help


Is this a bug in search method? [Closed]

René Schuster
on 12/13/13, 7:59 AM 673 views

The Question has been closed for reason: not relevant or out dated

René Schuster
on 06/26/2014 09:24:23

I'm doing something like this:

for tmp_p_line in self.pool.get('timesheet.project.line.wizard').browse(cr, uid, tmp_p_line_ids, context=context):
        p_line_id = p_lines.search(cr, uid, [('timesheet_line_id','=',line_id), ('project_id','=',tmp_p_line.project_id)]);

And get the following error:

Traceback (most recent call last):
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\netsvc.py", line 292, in  dispatch_rpc
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\service\web_services.py", line 626, in dispatch
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\osv\osv.py", line 188, in execute_kw
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\osv\osv.py", line 131, in wrapper
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\osv\osv.py", line 197, in execute
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\osv\osv.py", line 185, in execute_cr
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\openerp\addons\custom_timesheet\wizard\custom_timesheet_wizard.py", line 25, in save_project_lines
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\osv\orm.py", line 2358, in search
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\osv\orm.py", line 4857, in _search
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\osv\orm.py", line 4688, in _where_calc
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\osv\expression.py", line 1223, in to_sql
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\tools\misc.py", line 252, in flatten
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\tools\misc.py", line 250, in flatten
File "C:\Program Files (x86)\OpenERP 7.0-20131016-232725\Server\server\.\openerp\osv\orm.py", line 494, in __iter__
NotImplementedError: Iteration is not allowed on browse_record(project.project, 7)

Since I am not trying to iterate the return values of a browse method with just one selected id, I don't know what's wrong.
When I was trying to trace the error back, I came up with the assumption that there might be something wrong with expression.expression in _where_calc.

Is there any bug?

René Schuster
On 12/13/13, 8:09 AM

The second domain tuple has been wrong.

('project_id', '=', tmp_p_line.project_id.id)

solved it.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 12/13/13, 7:59 AM
Seen: 673 times
Last updated: 3/16/15, 8:10 AM